summaryrefslogtreecommitdiff
path: root/tools/include/nolibc/getopt.h
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2025-11-09 20:27:29 +0100
committerThomas Weißschuh <linux@weissschuh.net>2025-11-09 21:29:57 +0100
commit2d8482959efee5721456d199106b9c256c11b11b (patch)
tree6c8edf56d391f85955a4a759c3ad0cde2a7af3d7 /tools/include/nolibc/getopt.h
parent107eb8336e8782ae8e98b60962852a1e29aca715 (diff)
tools/nolibc: avoid using plain integer as NULL pointer
While an integer zero is a valid NULL pointer as per the C standard, sparse will complain about it. Use explicit NULL pointers instead. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202509261452.g5peaXCc-lkp@intel.com/ Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'tools/include/nolibc/getopt.h')
-rw-r--r--tools/include/nolibc/getopt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/include/nolibc/getopt.h b/tools/include/nolibc/getopt.h
index 217abb95264b..87565e3b6a33 100644
--- a/tools/include/nolibc/getopt.h
+++ b/tools/include/nolibc/getopt.h
@@ -78,7 +78,7 @@ int getopt(int argc, char * const argv[], const char *optstring)
return '?';
}
if (optstring[i] == ':') {
- optarg = 0;
+ optarg = NULL;
if (optstring[i + 1] != ':' || __optpos) {
optarg = argv[optind++];
if (__optpos)