summaryrefslogtreecommitdiff
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2017-12-13 16:07:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2017-12-13 16:07:55 +0000
commit26150ac5d3c74776311c2af4ec6a1498943ee345 (patch)
treeb469ac5cd0a51436b0eca319f6bf0033cddef952 /usr.bin/sed
parentec68f3cc37751c992922cfdd2e1688c90e30acc9 (diff)
Fix array index by signed char; from martijn@
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/compile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index cef3fddbbe7..f01e8f2d911 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compile.c,v 1.46 2017/12/13 16:06:34 millert Exp $ */
+/* $OpenBSD: compile.c,v 1.47 2017/12/13 16:07:54 millert Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -639,7 +639,6 @@ compile_tr(char *old, char **transtab)
else if (*old != delimiter && *old != '\\')
error(COMPILE, "Unexpected character after "
"backslash");
-
}
if (*new == '\\') {
new++;
@@ -649,9 +648,9 @@ compile_tr(char *old, char **transtab)
error(COMPILE, "Unexpected character after "
"backslash");
}
- if (check[*old] == 1)
+ if (check[(u_char) *old] == 1)
error(COMPILE, "Repeated character in source string");
- check[*old] = 1;
+ check[(u_char) *old] = 1;
(*transtab)[(u_char) *old++] = *new++;
}
if (*old != '\0' || *new != '\0')