allow passing hex or decimal arguments to -z (debug) flag

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
pull/136/head
Steven Noonan 6 years ago
parent e21b68f62e
commit 8aa4361118
No known key found for this signature in database
GPG Key ID: 408EEB508ED0CD4D

@ -635,8 +635,9 @@ int main(int argc, char** argv)
#if defined(DEBUG) || defined(_DEBUG) #if defined(DEBUG) || defined(_DEBUG)
case 'z': case 'z':
if (!(debugging = (unsigned int)atoi(optparse_state.optarg))) if (sscanf(optparse_state.optarg, "0x%x", &debugging) != 1)
usage(1); if (sscanf(optparse_state.optarg, "%u", &debugging) != 1)
usage(1);
break; break;
#endif /* DEBUG || _DEBUG */ #endif /* DEBUG || _DEBUG */

Loading…
Cancel
Save