summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-02-13 10:24:37 -0500
committerTavian Barnes <tavianator@tavianator.com>2025-02-13 10:24:37 -0500
commit85747829e77f3967ef2d5b64c98dbc42be425786 (patch)
treef006fb5eb06f794957afeaeec6a0dc1b94486a38 /tests
parent7f491ac752fb3565640330d68c9d7fa0ea7c0770 (diff)
downloadbfs-85747829e77f3967ef2d5b64c98dbc42be425786.tar.xz
tests/xtouch: Use xstrtol()
Diffstat (limited to 'tests')
-rw-r--r--tests/xtouch.c7
1 files changed, 2 insertions, 5 deletions
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);