-/* $OpenBSD: httpd.c,v 1.39 2015/08/20 13:00:23 reyk Exp $ */
+/* $OpenBSD: httpd.c,v 1.40 2015/10/13 07:57:13 reyk Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
for (i = j = 0; i < plen; i++) {
if (j >= (len - 1))
goto fail;
- c = tolower(host[i]);
+ c = tolower((unsigned char)host[i]);
if ((c == '.') && (j == 0 || name[j - 1] == '.'))
continue;
name[j++] = c;
switch (*p) {
case '%':
/* Encoding character is followed by two hex chars */
- if (!(isxdigit(p[1]) && isxdigit(p[2])))
+ if (!(isxdigit((unsigned char)p[1]) &&
+ isxdigit((unsigned char)p[2])))
return (NULL);
hex[0] = p[1];
-/* $OpenBSD: server_http.c,v 1.99 2015/09/07 14:46:24 reyk Exp $ */
+/* $OpenBSD: server_http.c,v 1.100 2015/10/13 07:57:13 reyk Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
/* Find previously matched substrings by index */
for (p = val; clt->clt_srv_match.sm_nmatch &&
(p = strstr(p, "%")) != NULL; p++) {
- if (!isdigit(*(p + 1)))
+ if (!isdigit((unsigned char)*(p + 1)))
continue;
/* Copy number, leading '%' char and add trailing \0 */