diff --git a/tools/ptraccel-debug.c b/tools/ptraccel-debug.c index d7eabc8f..5a972cf7 100644 --- a/tools/ptraccel-debug.c +++ b/tools/ptraccel-debug.c @@ -297,8 +297,7 @@ main(int argc, char **argv) } break; case OPT_NEVENTS: - nevents = atoi(optarg); - if (nevents == 0) { + if (!safe_atoi(optarg, &nevents) || nevents <= 0) { usage(); return 1; }