summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 687ccc8b0f1..fba035c33bd 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ */
+/* $OpenBSD: patch.c,v 1.51 2013/11/26 13:19:07 deraadt Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -508,7 +508,7 @@ get_some_switches(void)
break;
case 'D':
do_defines = true;
- if (!isalpha(*optarg) && *optarg != '_')
+ if (!isalpha((unsigned char)*optarg) && *optarg != '_')
fatal("argument to -D is not an identifier\n");
snprintf(if_defined, sizeof if_defined,
"#ifdef %s\n", optarg);
@@ -1030,12 +1030,12 @@ static bool
similar(const char *a, const char *b, int len)
{
while (len) {
- if (isspace(*b)) { /* whitespace (or \n) to match? */
- if (!isspace(*a)) /* no corresponding whitespace? */
- return false;
- while (len && isspace(*b) && *b != '\n')
+ if (isspace((unsigned char)*b)) { /* whitespace (or \n) to match? */
+ if (!isspace((unsigned char)*a))
+ return false; /* no corresponding whitespace */
+ while (len && isspace((unsigned char)*b) && *b != '\n')
b++, len--; /* skip pattern whitespace */
- while (isspace(*a) && *a != '\n')
+ while (isspace((unsigned char)*a) && *a != '\n')
a++; /* skip target whitespace */
if (*a == '\n' || *b == '\n')
return (*a == *b); /* should end in sync */