diff options
| author | dsl <dsl@NetBSD.org> | 2004-10-30 21:52:09 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2004-10-30 21:52:09 +0000 |
| commit | 58d3abc94fe87aa0473ebd1b254b99e0cd14d3a4 (patch) | |
| tree | b06636e31a14c996634c72243e1f3a0ea9f5d983 /usr.bin/patch | |
| parent | e2a58c7a44da7fe09f9b94d0d3b55d25acbdd336 (diff) | |
Add (unsigned char) cast to ctype functions
Stop infinite loop if get lower case char with no upper case equiv.
Diffstat (limited to 'usr.bin/patch')
| -rw-r--r-- | usr.bin/patch/util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/patch/util.c b/usr.bin/patch/util.c index 858d820269d..a1381dd7fbb 100644 --- a/usr.bin/patch/util.c +++ b/usr.bin/patch/util.c @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.19 2003/07/30 08:51:55 itojun Exp $ */ +/* $NetBSD: util.c,v 1.20 2004/10/30 21:52:09 dsl Exp $ */ /* * Copyright (c) 1988, Larry Wall @@ -24,7 +24,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: util.c,v 1.19 2003/07/30 08:51:55 itojun Exp $"); +__RCSID("$NetBSD: util.c,v 1.20 2004/10/30 21:52:09 dsl Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -102,11 +102,11 @@ move_file(char *from, char *to) to_inode == filestat.st_ino) { /* Skip initial non-lowercase chars. */ for (s = simplename; - *s && !islower((unsigned char)*s); + *s && *s == toupper((unsigned char)*s); s++) ; if (*s) - *s = toupper(*s); + *s = toupper((unsigned char)*s); else strcpy(simplename, simplename + 1); } |
