From f899da75528d442cf831085087b9fd245b8a2a99 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Apr 2026 10:29:56 +1000 Subject: [PATCH] tools/ptraccel-debug: replace atoi() with safe_atoi() It's a niche development/debugging tool, argument parsing issues aren't really something we need to care about but hey, this change is easy. Co-Authored-by: Claude Code Part-of: --- tools/ptraccel-debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; }