summaryrefslogtreecommitdiffstats
path: root/usr.bin/sort
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2002-04-04 21:55:44 +0000
committerache <ache@FreeBSD.org>2002-04-04 21:55:44 +0000
commita60be51cd447d9fd104957ad04440bde9ea3a0a1 (patch)
tree0da3409a138e604b4562abc32a0fbf2553b76314 /usr.bin/sort
parent29ebde295058c21420f7d91de4e7e21d0257fb5a (diff)
downloadFreeBSD-src-a60be51cd447d9fd104957ad04440bde9ea3a0a1.zip
FreeBSD-src-a60be51cd447d9fd104957ad04440bde9ea3a0a1.tar.gz
Cast ctype macros char arg to u_char to prevent sign extension
Diffstat (limited to 'usr.bin/sort')
-rw-r--r--usr.bin/sort/init.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/sort/init.c b/usr.bin/sort/init.c
index 861680e..f41b6de 100644
--- a/usr.bin/sort/init.c
+++ b/usr.bin/sort/init.c
@@ -135,7 +135,7 @@ setcolumn(pos, cur_fld, gflag)
int tmp;
col = cur_fld->icol.num ? (&(*cur_fld).tcol) : (&(*cur_fld).icol);
pos += sscanf(pos, "%d", &(col->num));
- while (isdigit(*pos))
+ while (isdigit((u_char)*pos))
pos++;
if (col->num <= 0 && !(col->num == 0 && col == &(cur_fld->tcol)))
errx(2, "field numbers must be positive");
@@ -144,7 +144,7 @@ setcolumn(pos, cur_fld, gflag)
errx(2, "cannot indent end of line");
++pos;
pos += sscanf(pos, "%d", &(col->indent));
- while (isdigit(*pos))
+ while (isdigit((u_char)*pos))
pos++;
if (&cur_fld->icol == col)
col->indent--;
@@ -251,7 +251,7 @@ fixit(argc, argv)
argv[i] = vpos;
vpos += sprintf(vpos, "-k");
tpos += sscanf(tpos, "%d", &v);
- while (isdigit(*tpos))
+ while (isdigit((u_char)*tpos))
tpos++;
vpos += sprintf(vpos, "%d", v+1);
if (*tpos == '.') {
@@ -263,16 +263,16 @@ fixit(argc, argv)
*vpos++ = *tpos++;
vpos += sprintf(vpos, ",");
if (argv[i+1] &&
- argv[i+1][0] == '-' && isdigit(argv[i+1][1])) {
+ argv[i+1][0] == '-' && isdigit((u_char)argv[i+1][1])) {
tpos = argv[i+1] + 1;
tpos += sscanf(tpos, "%d", &w);
- while (isdigit(*tpos))
+ while (isdigit((u_char)*tpos))
tpos++;
x = 0;
if (*tpos == '.') {
++tpos;
tpos += sscanf(tpos, "%d", &x);
- while (isdigit(*tpos))
+ while (isdigit((u_char)*tpos))
tpos++;
}
if (x) {
OpenPOWER on IntegriCloud