From: Steven Noonan Date: Sun, 30 Sep 2018 21:05:39 +0000 (-0700) Subject: allow passing hex or decimal arguments to -z (debug) flag X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8aa436111820e07ec06034e0c37cbe7ad4a7d500;p=fping.git allow passing hex or decimal arguments to -z (debug) flag Signed-off-by: Steven Noonan --- diff --git a/src/fping.c b/src/fping.c index 7905c58..a499422 100644 --- a/src/fping.c +++ b/src/fping.c @@ -635,8 +635,9 @@ int main(int argc, char** argv) #if defined(DEBUG) || defined(_DEBUG) case 'z': - if (!(debugging = (unsigned int)atoi(optparse_state.optarg))) - usage(1); + if (sscanf(optparse_state.optarg, "0x%x", &debugging) != 1) + if (sscanf(optparse_state.optarg, "%u", &debugging) != 1) + usage(1); break; #endif /* DEBUG || _DEBUG */