summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-10-13 08:53:44 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-10-13 08:53:44 +0000
commit6d241e62f67bd28e6aba209202f0a32fbb8c78b7 (patch)
tree6b15c03f7d4afa83d97d7c73bc26434bc443e99d
parentd69ae064a4a6cc0082c84febcbacab5aa45dfe78 (diff)
ctype functions isxdigit() expect an unsigned char value; add missing casts
and adjust variable types to get correct behavior ok beck@ millert@
-rw-r--r--usr.bin/ftp/fetch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index f7cfd99f019..bd3a3b3a836 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.142 2015/09/10 13:43:35 jsing Exp $ */
+/* $OpenBSD: fetch.c,v 1.143 2015/10/13 08:53:43 guenther Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -1374,7 +1374,8 @@ urldecode(const char *str)
/* Cannot use strtol here because next char
* after %xx may be a digit.
*/
- if (c == '%' && isxdigit(str[i+1]) && isxdigit(str[i+2])) {
+ if (c == '%' && isxdigit((unsigned char)str[i+1]) &&
+ isxdigit((unsigned char)str[i+2])) {
*ret = hextochar(&str[i+1]);
i+=2;
continue;
@@ -1409,7 +1410,7 @@ recode_credentials(const char *userinfo)
char
hextochar(const char *str)
{
- char c, ret;
+ unsigned char c, ret;
c = str[0];
ret = c;