-/* $OpenBSD: aux.c,v 1.25 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: aux.c,v 1.26 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */
/*
return(-1);
if ((c = readline(f, linebuf, LINESIZE, NULL)) <= 0)
return(-1);
- for (cp = linebuf; isprint(*cp) && *cp != ' ' && *cp != ':';
- cp++)
+ for (cp = linebuf;
+ isprint((unsigned char)*cp) && *cp != ' ' && *cp != ':';
+ cp++)
;
if (*cp != ':' || cp == linebuf)
continue;
/* Copy as many bytes as will fit */
if (n != 0 && --n != 0) {
do {
- if ((*d++ = tolower(*s++)) == 0)
+ if ((*d++ = tolower((unsigned char)*s++)) == 0)
break;
} while (--n != 0);
}
gotlt = 0;
lastsp = 0;
bufend = nbuf;
- for (cp = name, cp2 = bufend; (c = *cp++) != '\0'; ) {
+ for (cp = name, cp2 = bufend; (c = (unsigned char)*cp++) != '\0'; ) {
switch (c) {
case '(':
cp = skip_comment(cp);
* Start of a "quoted-string".
* Copy it in its entirety.
*/
- while ((c = *cp) != '\0') {
+ while ((c = (unsigned char)*cp) != '\0') {
cp++;
if (c == '"')
break;
if (c != '\\')
*cp2++ = c;
- else if ((c = *cp) != '\0') {
+ else if ((c = (unsigned char)*cp) != '\0') {
*cp2++ = c;
cp++;
}
case '>':
if (gotlt) {
gotlt = 0;
- while ((c = *cp) && c != ',') {
+ while ((c = (unsigned char)*cp) && c != ',') {
cp++;
if (c == '(')
cp = skip_comment(cp);
else if (c == '"')
- while ((c = *cp) != '\0') {
+ while ((c = (unsigned char)*cp) != '\0') {
cp++;
if (c == '"')
break;
-/* $OpenBSD: cmd2.c,v 1.19 2012/11/14 13:22:37 gsoares Exp $ */
+/* $OpenBSD: cmd2.c,v 1.20 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $ */
/*
/*
* Strip away trailing blanks.
*/
- while (cp > linebuf && isspace(*cp))
+ while (cp > linebuf && isspace((unsigned char)*cp))
cp--;
*++cp = 0;
/*
* Now search for the beginning of the file name.
*/
- while (cp > linebuf && !isspace(*cp))
+ while (cp > linebuf && !isspace((unsigned char)*cp))
cp--;
if (*cp == '\0') {
puts("No file specified.");
return(NULL);
}
- if (isspace(*cp))
+ if (isspace((unsigned char)*cp))
*cp++ = 0;
else
*flag = 0;
-/* $OpenBSD: collect.c,v 1.33 2011/04/06 11:36:26 miod Exp $ */
+/* $OpenBSD: collect.c,v 1.34 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: collect.c,v 1.9 1997/07/09 05:25:45 mikel Exp $ */
/*
goto err;
continue;
}
- c = linebuf[1];
+ c = (unsigned char)linebuf[1];
switch (c) {
default:
/*
* Set the Subject list.
*/
cp = &linebuf[2];
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
hp->h_subject = savestr(cp);
break;
* then open it and copy the contents to collf.
*/
cp = &linebuf[2];
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
if (*cp == '\0') {
puts("Interpolate what file?");
-/* $OpenBSD: fio.c,v 1.32 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: fio.c,v 1.33 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: fio.c,v 1.8 1997/07/07 22:57:55 phil Exp $ */
/*
inhead = 0;
} else if (inhead) {
for (cp = linebuf, cp2 = "status";; cp++) {
- if ((c = *cp2++) == 0) {
+ if ((c = (unsigned char)*cp2++) == 0) {
while (isspace(*cp++))
;
if (cp[-1] != ':')
break;
- while ((c = *cp++) != '\0')
+ while ((c = (unsigned char)*cp++) != '\0')
if (c == 'R')
this.m_flag |= MREAD;
else if (c == 'O')
-/* $OpenBSD: head.c,v 1.11 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: head.c,v 1.12 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: head.c,v 1.6 1996/12/28 07:11:03 tls Exp $ */
/*
while (*cp && *tp)
switch (*tp++) {
case 'a':
- if (!islower(*cp++))
+ if (!islower((unsigned char)*cp++))
return(0);
break;
case 'A':
- if (!isupper(*cp++))
+ if (!isupper((unsigned char)*cp++))
return(0);
break;
case ' ':
return(0);
break;
case '0':
- if (!isdigit(*cp++))
+ if (!isdigit((unsigned char)*cp++))
return(0);
break;
case 'O':
- if (*cp != ' ' && !isdigit(*cp))
+ if (*cp != ' ' && !isdigit((unsigned char)*cp))
return(0);
cp++;
break;
case 'p':
- if (!ispunct(*cp++))
+ if (!ispunct((unsigned char)*cp++))
return(0);
break;
case 'P':
- if (*cp != ' ' && !ispunct(*cp))
+ if (*cp != ' ' && !ispunct((unsigned char)*cp))
return(0);
cp++;
break;
*wbuf = 0;
return(NULL);
}
- while ((c = *wp++) && c != ' ' && c != '\t') {
+ while ((c = (unsigned char)*wp++) && c != ' ' && c != '\t') {
*wbuf++ = c;
if (c == '"') {
- while ((c = *wp++) && c != '"')
+ while ((c = (unsigned char)*wp++) && c != '"')
*wbuf++ = c;
if (c == '"')
*wbuf++ = c;
}
}
*wbuf = '\0';
- for (; c == ' ' || c == '\t'; c = *wp++)
+ for (; c == ' ' || c == '\t'; c = (unsigned char)*wp++)
;
if (c == 0)
return(NULL);
-/* $OpenBSD: lex.c,v 1.35 2013/04/29 00:28:23 okan Exp $ */
+/* $OpenBSD: lex.c,v 1.36 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */
/*
* Handle ! escapes differently to get the correct
* lexical conventions.
*/
- for (cp = linebuf; isspace(*cp); cp++)
+ for (cp = linebuf; isspace((unsigned char)*cp); cp++)
;
if (*cp == '!') {
if (sourcing) {
return(0);
}
cp2 = word;
- while (*cp && strchr(" \t0123456789$^.:/-+*'\"", *cp) == NULL)
+ while (*cp &&
+ strchr(" \t0123456789$^.:/-+*'\"", (unsigned char)*cp) == NULL)
*cp2++ = *cp++;
*cp2 = '\0';
/*
* remove leading blanks.
*/
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
- if (isdigit(*cp) || *cp == ':') {
+ if (isdigit((unsigned char)*cp) || *cp == ':') {
if ((c = getmsglist(cp, msgvec, com->c_msgflag)) < 0)
break;
/* position to next space - past the message list */
- while (!isspace(*cp))
+ while (!isspace((unsigned char)*cp))
cp++;
/* position to next non-space */
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
} else {
c = 0; /* no message list */
* Just the straight string, with
* leading blanks removed.
*/
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
e = (*com->c_func2)(msgvec, cp);
* Just the straight string, with
* leading blanks removed.
*/
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
e = (*com->c_func)(cp);
break;
-/* $OpenBSD: list.c,v 1.18 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: list.c,v 1.19 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: list.c,v 1.7 1997/07/09 05:23:36 mikel Exp $ */
/*
}
cp = *sp;
cp2 = lexstring;
- c = *cp++;
+ c = (unsigned char)*cp++;
/*
* strip away leading white space.
*/
while (c == ' ' || c == '\t')
- c = *cp++;
+ c = (unsigned char)*cp++;
/*
* If no characters remain, we are at end of line,
lexnumber = lexnumber*10 + c - '0';
if (cp2 - lexstring < STRINGLEN - 1)
*cp2++ = c;
- c = *cp++;
+ c = (unsigned char)*cp++;
}
*cp2 = '\0';
*sp = --cp;
quotec = 0;
if (c == '\'' || c == '"') {
quotec = c;
- c = *cp++;
+ c = (unsigned char)*cp++;
}
while (c != '\0') {
if (c == quotec) {
break;
if (cp2 - lexstring < STRINGLEN-1)
*cp2++ = c;
- c = *cp++;
+ c = (unsigned char)*cp++;
}
if (quotec && c == 0) {
fprintf(stderr, "Missing %c\n", quotec);
-/* $OpenBSD: send.c,v 1.22 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: send.c,v 1.23 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */
/*
/*
* Pick up the header field if we have one.
*/
- for (cp = line; (c = *cp++) && c != ':' && !isspace(c);)
+ for (cp = line;
+ (c = (unsigned char)*cp++) && c != ':' && !isspace(c); )
;
cp2 = --cp;
- while (isspace(*cp++))
+ while (isspace((unsigned char)*cp++))
;
if (cp[-1] != ':') {
/*
-/* $OpenBSD: tty.c,v 1.19 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.20 2014/01/17 18:42:30 okan Exp $ */
/* $NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $ */
/*
fflush(stdout);
#else
cp = src == NULL ? "" : src;
- while ((c = *cp++) != '\0') {
+ while ((c = (unsigned char)*cp++) != '\0') {
if ((c_erase != _POSIX_VDISABLE && c == c_erase) ||
(c_kill != _POSIX_VDISABLE && c == c_kill)) {
ch = '\\';
if (!ttyset)
return(strlen(canonb) > 0 ? savestr(canonb) : NULL);
while (*cp != '\0') {
- c = *cp++;
+ c = (unsigned char)*cp++;
if (c_erase != _POSIX_VDISABLE && c == c_erase) {
if (cp2 == canonb)
continue;