Fixed wrong use of the <ctype.h> functions by adding an explicit conversion

to unsigned char. Approved by christos.
This commit is contained in:
rillig 2005-04-19 20:14:29 +00:00
parent 117d073a60
commit 4f6457e756
8 changed files with 28 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.14 2005/02/17 16:29:26 xtraeme Exp $ */
/* $NetBSD: main.c,v 1.15 2005/04/19 20:18:20 rillig Exp $ */
/* main.c: This file contains the main control and user-interface routines
for the ed line editor. */
@ -39,7 +39,7 @@ __COPYRIGHT(
#if 0
static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
#else
__RCSID("$NetBSD: main.c,v 1.14 2005/02/17 16:29:26 xtraeme Exp $");
__RCSID("$NetBSD: main.c,v 1.15 2005/04/19 20:18:20 rillig Exp $");
#endif
#endif /* not lint */
@ -345,7 +345,7 @@ next_addr(void)
case '\'':
MUST_BE_FIRST();
ibufp++;
if ((addr = get_marked_node_addr(*ibufp++)) < 0)
if ((addr = get_marked_node_addr((unsigned char)*ibufp++)) < 0)
return ERR;
break;
case '%':
@ -600,7 +600,7 @@ exec_command(void)
return ERR;
}
GET_COMMAND_SUFFIX();
if (mark_line_node(get_addressed_line_node(second_addr), c) < 0)
if (mark_line_node(get_addressed_line_node(second_addr), (unsigned char)c) < 0)
return ERR;
break;
case 'l':

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.c,v 1.9 2004/07/07 19:20:09 mycroft Exp $ */
/* $NetBSD: exec.c,v 1.10 2005/04/19 20:14:29 rillig Exp $ */
/*
* execute command tree
@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: exec.c,v 1.9 2004/07/07 19:20:09 mycroft Exp $");
__RCSID("$NetBSD: exec.c,v 1.10 2005/04/19 20:14:29 rillig Exp $");
#endif
@ -782,7 +782,7 @@ scriptexec(tp, ap)
}
if ((buf[0] == '#' && buf[1] == '!' && (cp = &buf[2]))
# ifdef OS2
|| (strncmp(buf, "extproc", 7) == 0 && isspace(buf[7])
|| (strncmp(buf, "extproc", 7) == 0 && isspace((unsigned char)buf[7])
&& (cp = &buf[7]))
# endif /* OS2 */
)

View File

@ -1,4 +1,4 @@
/* $NetBSD: expr.c,v 1.6 2004/07/07 19:20:09 mycroft Exp $ */
/* $NetBSD: expr.c,v 1.7 2005/04/19 20:14:29 rillig Exp $ */
/*
* Korn expression evaluation
@ -9,7 +9,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: expr.c,v 1.6 2004/07/07 19:20:09 mycroft Exp $");
__RCSID("$NetBSD: expr.c,v 1.7 2005/04/19 20:14:29 rillig Exp $");
#endif
@ -471,7 +471,7 @@ token(es)
char *tvar;
/* skip white space */
for (cp = es->tokp; (c = *cp), isspace(c); cp++)
for (cp = es->tokp; (c = *cp), isspace((unsigned char)c); cp++)
;
es->tokp = cp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lex.c,v 1.10 2004/07/07 19:20:09 mycroft Exp $ */
/* $NetBSD: lex.c,v 1.11 2005/04/19 20:14:29 rillig Exp $ */
/*
* lexical analysis and source input
@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: lex.c,v 1.10 2004/07/07 19:20:09 mycroft Exp $");
__RCSID("$NetBSD: lex.c,v 1.11 2005/04/19 20:14:29 rillig Exp $");
#endif
@ -221,7 +221,7 @@ yylex(cf)
case '\\':
c = getsc();
#ifdef OS2
if (isalnum(c)) {
if (isalnum((unsigned char)c)) {
*wp++ = CHAR, *wp++ = '\\';
*wp++ = CHAR, *wp++ = c;
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: misc.c,v 1.10 2005/02/11 06:21:21 simonb Exp $ */
/* $NetBSD: misc.c,v 1.11 2005/04/19 20:14:29 rillig Exp $ */
/*
* Miscellaneous functions
@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: misc.c,v 1.10 2005/02/11 06:21:21 simonb Exp $");
__RCSID("$NetBSD: misc.c,v 1.11 2005/04/19 20:14:29 rillig Exp $");
#endif
@ -642,8 +642,8 @@ do_gmatch(s, se, p, pe, isfile)
sc = s < se ? *s : '\0';
s++;
if (isfile) {
sc = FILECHCONV(sc);
pc = FILECHCONV(pc);
sc = FILECHCONV((unsigned char)sc);
pc = FILECHCONV((unsigned char)pc);
}
if (!ISMAGIC(pc)) {
if (sc != pc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: mkdict.c,v 1.9 2003/08/07 09:37:06 agc Exp $ */
/* $NetBSD: mkdict.c,v 1.10 2005/04/19 20:19:09 rillig Exp $ */
/*-
* Copyright (c) 1993
@ -40,7 +40,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)mkdict.c 8.1 (Berkeley) 6/11/93";
#else
static const char rcsid[] =
"$NetBSD: mkdict.c,v 1.9 2003/08/07 09:37:06 agc Exp $";
"$NetBSD: mkdict.c,v 1.10 2005/04/19 20:19:09 rillig Exp $";
#endif
#endif /* not lint */
@ -87,7 +87,7 @@ main(argc, argv)
}
len = 0;
for (p = buf[current]; *p != '\n'; p++) {
if (!islower(*p))
if (!islower((unsigned char)*p))
break;
if (*p == 'q') {
q = p + 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: strfile.c,v 1.22 2003/08/07 09:37:14 agc Exp $ */
/* $NetBSD: strfile.c,v 1.23 2005/04/19 20:16:19 rillig Exp $ */
/*-
* Copyright (c) 1989, 1993
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: strfile.c,v 1.22 2003/08/07 09:37:14 agc Exp $");
__RCSID("$NetBSD: strfile.c,v 1.23 2005/04/19 20:16:19 rillig Exp $");
#endif
#endif /* not lint */
#endif /* __NetBSD__ */
@ -224,12 +224,12 @@ main(ac, av)
first = Oflag;
}
else if (first) {
for (nsp = sp; !isalnum(*nsp); nsp++)
for (nsp = sp; !isalnum((unsigned char)*nsp); nsp++)
continue;
ALLOC(Firstch, Num_pts);
fp = &Firstch[Num_pts - 1];
if (Iflag && isupper(*nsp))
fp->first = tolower(*nsp);
if (Iflag && isupper((unsigned char)*nsp))
fp->first = tolower((unsigned char)*nsp);
else
fp->first = *nsp;
fp->pos = Seekpts[Num_pts - 1];

View File

@ -1,4 +1,4 @@
/* $NetBSD: stoc.c,v 1.8 2004/11/05 21:30:32 dsl Exp $ */
/* $NetBSD: stoc.c,v 1.9 2005/04/19 20:17:12 rillig Exp $ */
/*
* Copyright (c) 1994
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)stoc.c 8.1 (Berkeley) 7/24/94";
#else
__RCSID("$NetBSD: stoc.c,v 1.8 2004/11/05 21:30:32 dsl Exp $");
__RCSID("$NetBSD: stoc.c,v 1.9 2005/04/19 20:17:12 rillig Exp $");
#endif
#endif /* not lint */
@ -93,7 +93,7 @@ ctos(mp)
i = atoi(&mp[1]);
if (i < 1 || i > 19)
return(ILLEGAL);
return(PT(lton(mp[0]), i));
return(PT(lton((unsigned char)mp[0]), i));
}
/*