From 85747829e77f3967ef2d5b64c98dbc42be425786 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 13 Feb 2025 10:24:37 -0500 Subject: tests/xtouch: Use xstrtol() --- tests/xtouch.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/xtouch.c b/tests/xtouch.c index e7c2e00..5d65a4c 100644 --- a/tests/xtouch.c +++ b/tests/xtouch.c @@ -217,11 +217,8 @@ int main(int argc, char *argv[]) { } if (marg) { - char *end; - long mode = strtol(marg, &end, 8); - // https://github.com/llvm/llvm-project/issues/64946 - sanitize_init(&end); - if (*marg && !*end && mode >= 0 && mode < 01000) { + long mode; + if (xstrtol(marg, NULL, 8, &mode) == 0 && mode >= 0 && mode < 01000) { args.fmode = args.dmode = mode; } else { fprintf(stderr, "%s: Invalid mode '%s'\n", cmd, marg); -- cgit v1.2.3