Add (unsigned char) cast to ctype functions
This commit is contained in:
parent
c343fd9713
commit
e219d781d7
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: skeyinit.c,v 1.23 2004/01/05 23:23:37 jmmv Exp $ */
|
||||
/* $NetBSD: skeyinit.c,v 1.24 2004/11/03 20:10:08 dsl Exp $ */
|
||||
|
||||
/* S/KEY v1.1b (skeyinit.c)
|
||||
*
|
||||
@ -17,7 +17,7 @@
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: skeyinit.c,v 1.23 2004/01/05 23:23:37 jmmv Exp $");
|
||||
__RCSID("$NetBSD: skeyinit.c,v 1.24 2004/11/03 20:10:08 dsl Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -84,7 +84,7 @@ int main(int argc, char **argv)
|
||||
defaultseed[l] = hostname[i];
|
||||
break;
|
||||
}
|
||||
if (isalnum(hostname[i]))
|
||||
if (isalnum((unsigned char)hostname[i]))
|
||||
defaultseed[l++] = hostname[i];
|
||||
}
|
||||
|
||||
@ -222,10 +222,9 @@ int main(int argc, char **argv)
|
||||
fgets(seed, sizeof(seed), stdin);
|
||||
rip(seed);
|
||||
for (p = seed; *p; p++) {
|
||||
if (isalpha(*p)) {
|
||||
if (isupper(*p))
|
||||
*p = tolower(*p);
|
||||
} else if (!isdigit(*p)) {
|
||||
if (isalpha((unsigned char)*p)) {
|
||||
*p = tolower((unsigned char)*p);
|
||||
} else if (!isdigit((unsigned char)*p)) {
|
||||
(void)puts("Error: seed may only contain alphanumeric characters");
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: init.c,v 1.15 2004/02/18 20:44:36 jdolecek Exp $ */
|
||||
/* $NetBSD: init.c,v 1.16 2004/11/03 20:14:36 dsl Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
|
||||
@ -71,7 +71,7 @@
|
||||
#include "sort.h"
|
||||
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: init.c,v 1.15 2004/02/18 20:44:36 jdolecek Exp $");
|
||||
__RCSID("$NetBSD: init.c,v 1.16 2004/11/03 20:14:36 dsl Exp $");
|
||||
__SCCSID("@(#)init.c 8.1 (Berkeley) 6/6/93");
|
||||
#endif /* not lint */
|
||||
|
||||
@ -282,7 +282,7 @@ fixit(argc, argv)
|
||||
if (argv[i][0] != '+' && !fplus)
|
||||
continue;
|
||||
|
||||
if (fplus && (argv[i][0] != '-' || !isdigit(argv[i][1]))) {
|
||||
if (fplus && (argv[i][0] != '-' || !isdigit((unsigned char)argv[i][1]))) {
|
||||
fplus = 0;
|
||||
if (argv[i][0] != '+') {
|
||||
/* not a -POS argument, skip */
|
||||
|
Loading…
Reference in New Issue
Block a user