diff options
author | Craig Small <csmall@dropbear.xyz> | 2022-01-08 07:47:46 +1100 |
---|---|---|
committer | Craig Small <csmall@dropbear.xyz> | 2022-01-08 07:47:46 +1100 |
commit | 8b67402a25ea356b821fc7a1309dc781e43948fe (patch) | |
tree | aa3f6b18be0c16255e3fcdd0517751d1781310aa | |
parent | 91ffe817343a43ac67a1a1ffaf1d02aca2760b11 (diff) | |
download | procps-ng-8b67402a25ea356b821fc7a1309dc781e43948fe.tar.gz |
pmap: Fix minor compiler warning
/usr/include/x86_64-linux-gnu/bits/error.h:40:5: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
40 | __error_noreturn (__status, __errnum, __format, __va_arg_pack ());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pmap.c: In function ‘main’:
pmap.c:760:35: note: format string is defined here
760 | xerrx(EXIT_FAILURE, "%s: '%s'", _("failed to parse argument"), optarg);
A simple check for optarg being null silenced this, not sure why only
this one was a problem.
Signed-off-by: Craig Small <csmall@dropbear.xyz>
-rw-r--r-- | pmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -758,7 +758,7 @@ static void range_arguments(const char *optarg) if ((buf = xstrdup(optarg)) == NULL) { xerrx(EXIT_FAILURE, "%s: '%s'", _("failed to parse argument"), - optarg); + (optarg?optarg:"(null)")); } arg1 = buf; arg2 = strchr(arg1, ','); |