]> www.infradead.org Git - users/willy/xarray.git/commit
tools: ynl: error check scanf() in a sample
authorJakub Kicinski <kuba@kernel.org>
Wed, 28 Aug 2024 17:36:09 +0000 (10:36 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 29 Aug 2024 19:43:29 +0000 (12:43 -0700)
commit3d8806f37d318b10ddf9fa686821f58bc6301c7b
treeaaff1c1e343dbcb16143c84939d4c9e60d395548
parentd64d11b733dd435c9fce6397bcc0d235c68d1b39
tools: ynl: error check scanf() in a sample

Someone reported on GitHub that the YNL NIPA test is failing
when run locally. The test builds the tools, and it hits:

  netdev.c:82:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  82 | scanf("%d", &ifindex);

I can't repro this on my setups but error seems clear enough.

Link: https://github.com/linux-netdev/nipa/discussions/37
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://patch.msgid.link/20240828173609.2951335-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/samples/netdev.c