summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/hash.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-06-25 08:04:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-06-25 08:04:39 +0000
commite692918b34b127e3be7ef00fd470c90ff8adb3ca (patch)
tree392424f5045e66e50a96a5f7e4b217da870dcf69 /src/emu/hash.c
parentf7ce2a786aaa4ac5e9f82daa4b78ee89ca5ef46c (diff)
Added casts to ensure proper values are passed to the ctype.h functions.
[Juergen Buchmueller]
Diffstat (limited to 'src/emu/hash.c')
-rw-r--r--src/emu/hash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/emu/hash.c b/src/emu/hash.c
index bdf8fbb519e..00e227034ec 100644
--- a/src/emu/hash.c
+++ b/src/emu/hash.c
@@ -278,7 +278,7 @@ static int hash_compare_checksum(const char* chk1, const char* chk2, int length)
c1 = *chk1++;
c2 = *chk2++;
- if (tolower(c1) != tolower(c2))
+ if (tolower((UINT8)c1) != tolower((UINT8)c2))
return 0;
if (!c1)
return 0;
@@ -381,7 +381,7 @@ int hash_data_extract_printable_checksum(const char* data, unsigned int function
// Copy the checksum (and make it lowercase)
for (i=0;i<info->size*2;i++)
- checksum[i] = tolower(data[i]);
+ checksum[i] = tolower((UINT8)data[i]);
checksum[info->size*2] = '\0';
@@ -395,7 +395,7 @@ static int hex_string_to_binary(unsigned char* binary, const char* data, int siz
for (i = 0; i < size * 2; i++)
{
- c = tolower(*data++);
+ c = tolower((UINT8)*data++);
if (c >= '0' && c <= '9')
c -= '0';
@@ -590,7 +590,7 @@ void hash_data_print(const char* data, unsigned int functions, char* buffer)
strcpy(temp, hash_function_name(func));
for (j = 0; temp[j]; j++)
- temp[j] = toupper(temp[j]);
+ temp[j] = toupper((UINT8)temp[j]);
strcat(buffer, temp);
strcat(buffer, "(");
@@ -637,7 +637,7 @@ int hash_verify_string(const char *hash)
for (i = 0; (hash[i] != '#') && (i < len); i++)
{
- if (!isxdigit(hash[i]))
+ if (!isxdigit((UINT8)hash[i]))
return FALSE;
}
if (hash[i] != '#')