diff options
author | 2013-11-26 13:18:53 +0000 | |
---|---|---|
committer | 2013-11-26 13:18:53 +0000 | |
commit | 6cd4fad2c367a960587b848cba814f7a2ee9280c (patch) | |
tree | edd224b3ecdcb78ffd0ceb225a9885c7ab0f2d15 /usr.bin/patch/backupfile.c | |
parent | unsigned char cast for ctype; ok guenther (diff) | |
download | wireguard-openbsd-6cd4fad2c367a960587b848cba814f7a2ee9280c.tar.xz wireguard-openbsd-6cd4fad2c367a960587b848cba814f7a2ee9280c.zip |
unsigned char casts for ctype
ok krw
Diffstat (limited to 'usr.bin/patch/backupfile.c')
-rw-r--r-- | usr.bin/patch/backupfile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c index 2d4037b6638..d9e40bcba7e 100644 --- a/usr.bin/patch/backupfile.c +++ b/usr.bin/patch/backupfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: backupfile.c,v 1.20 2009/10/27 23:59:41 deraadt Exp $ */ +/* $OpenBSD: backupfile.c,v 1.21 2013/11/26 13:19:07 deraadt Exp $ */ /* * backupfile.c -- make Emacs style backup file names Copyright (C) 1990 Free @@ -132,8 +132,9 @@ version_number(const char *base, const char *backup, size_t base_length) const char *p; version = 0; - if (!strncmp(base, backup, base_length) && ISDIGIT(backup[base_length])) { - for (p = &backup[base_length]; ISDIGIT(*p); ++p) + if (!strncmp(base, backup, base_length) && + ISDIGIT((unsigned char)backup[base_length])) { + for (p = &backup[base_length]; ISDIGIT((unsigned char)*p); ++p) version = version * 10 + *p - '0'; if (p[0] != '~' || p[1]) version = 0; |