]> granicus.if.org Git - curl/commitdiff
curl_ntlm_core: pass unsigned char to toupper
authorMarcel Raad <raad@teamviewer.com>
Sun, 4 Jun 2017 14:46:03 +0000 (16:46 +0200)
committerMarcel Raad <raad@teamviewer.com>
Sun, 4 Jun 2017 14:46:03 +0000 (16:46 +0200)
Otherwise, clang on Cygwin64 warns:
curl_ntlm_core.c:525:35: error: array subscript is of type 'char'
[-Werror,-Wchar-subscripts]
    dest[2 * i] = (unsigned char)(toupper(src[i]));
                                  ^~~~~~~~~~~~~~~
/usr/include/ctype.h:152:25: note: expanded from macro 'toupper'
      (void) __CTYPE_PTR[__x]; (toupper) (__x);})
                        ^~~~

lib/curl_ntlm_core.c

index b15215b2f9e4e9137c4d4d00b2f3bac56d374f59..25f2a3ad408a6ca0cb278f3aee0b2f004c474c38 100644 (file)
@@ -522,7 +522,7 @@ static void ascii_uppercase_to_unicode_le(unsigned char *dest,
 {
   size_t i;
   for(i = 0; i < srclen; i++) {
-    dest[2 * i] = (unsigned char)(toupper(src[i]));
+    dest[2 * i] = (unsigned char)(toupper((unsigned char)src[i]));
     dest[2 * i + 1] = '\0';
   }
 }