1
1

Merge pull request #245 from he32/tolower-fix

Two more casts for tolower() to silence compiler warnings
Этот коммит содержится в:
Bruce A. Mah 2015-02-12 14:48:14 -08:00
родитель 6bd4e258d0 c95ee19c59
Коммит 6709836366
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -58,10 +58,10 @@ static int cJSON_strcasecmp( const char *s1, const char *s2 )
return ( s1 == s2 ) ? 0 : 1;
if ( ! s2 )
return 1;
for ( ; tolower(*s1) == tolower(*s2); ++s1, ++s2)
for ( ; tolower((u_char)*s1) == tolower((u_char)*s2); ++s1, ++s2)
if( *s1 == 0 )
return 0;
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
return tolower((u_char)*s1) - tolower((u_char)*s2);
}

Просмотреть файл

@ -58,6 +58,7 @@
#include <stdint.h>
#endif
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/time.h>
#include <netinet/tcp.h>
@ -261,7 +262,7 @@ extern "C"
{
inNum *= 8;
}
switch (toupper(inFormat))
switch (toupper((u_char)inFormat))
{
case 'B':
conv = UNIT_CONV;