summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/backupfile.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-11-26 13:18:53 +0000
committerderaadt <deraadt@openbsd.org>2013-11-26 13:18:53 +0000
commit6cd4fad2c367a960587b848cba814f7a2ee9280c (patch)
treeedd224b3ecdcb78ffd0ceb225a9885c7ab0f2d15 /usr.bin/patch/backupfile.c
parentunsigned char cast for ctype; ok guenther (diff)
downloadwireguard-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.c7
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;