From d67f4d918d26681bb822d5d0db34e5dbfc30a169 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Thu, 4 Nov 1999 04:46:18 +0000 Subject: [PATCH] Add unsigned char cast to isdigit --- lib/libc/gen/disklabel.c | 2 +- lib/libc/gen/setmode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c index 82a3b3c270e..c7ac0b4f8a9 100644 --- a/lib/libc/gen/disklabel.c +++ b/lib/libc/gen/disklabel.c @@ -171,7 +171,7 @@ gettype(t, names) for (nm = names; *nm; nm++) if (strcasecmp(t, *nm) == 0) return (nm - names); - if (isdigit(*t)) + if (isdigit((unsigned char)*t)) return (atoi(t)); return (0); } diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c index 0bbf22df7d0..2c12b818b61 100644 --- a/lib/libc/gen/setmode.c +++ b/lib/libc/gen/setmode.c @@ -204,7 +204,7 @@ setmode(p) * If an absolute number, get it and return; disallow non-octal digits * or illegal bits. */ - if (isdigit(*p)) { + if (isdigit((unsigned char)*p)) { perm = (mode_t)strtol(p, NULL, 8); if (perm & ~(STANDARD_BITS|S_ISTXT)) { free(saveset);