summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
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/tools
parentf7ce2a786aaa4ac5e9f82daa4b78ee89ca5ef46c (diff)
Added casts to ensure proper values are passed to the ctype.h functions.
[Juergen Buchmueller]
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/chdcd.c10
-rw-r--r--src/tools/chdman.c2
-rw-r--r--src/tools/jedutil.c12
-rw-r--r--src/tools/ldverify.c4
-rw-r--r--src/tools/regrep.c8
5 files changed, 18 insertions, 18 deletions
diff --git a/src/tools/chdcd.c b/src/tools/chdcd.c
index 5711f51ebd3..403840394cf 100644
--- a/src/tools/chdcd.c
+++ b/src/tools/chdcd.c
@@ -61,7 +61,7 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to
int singlequote = 0;
int doublequote = 0;
- while ((i < linebuffersize) && isspace(linebuffer[i]))
+ while ((i < linebuffersize) && isspace((UINT8)linebuffer[i]))
{
i++;
}
@@ -76,7 +76,7 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to
{
singlequote = !singlequote;
}
- else if (!singlequote && !doublequote && isspace(linebuffer[i]))
+ else if (!singlequote && !doublequote && isspace((UINT8)linebuffer[i]))
{
break;
}
@@ -298,7 +298,7 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc *outtoc, chdcd_track_i
/* it's a decimal offset, use it */
f = strtoul(&token[1], NULL, 10);
}
- else if (isdigit(token[0]))
+ else if (isdigit((UINT8)token[0]))
{
/* convert the time to an offset */
f = msf_to_frames( token );
@@ -314,14 +314,14 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc *outtoc, chdcd_track_i
TOKENIZE
- if (isdigit(token[0]))
+ if (isdigit((UINT8)token[0]))
{
// this could be the length or an offset from the previous field.
f = msf_to_frames( token );
TOKENIZE
- if (isdigit(token[0]))
+ if (isdigit((UINT8)token[0]))
{
// it was an offset.
f *= (outtoc->tracks[trknum].datasize + outtoc->tracks[trknum].subsize);
diff --git a/src/tools/chdman.c b/src/tools/chdman.c
index 0f2a8e8957c..8165710ab4f 100644
--- a/src/tools/chdman.c
+++ b/src/tools/chdman.c
@@ -313,7 +313,7 @@ static int do_createhd(int argc, char *argv[], int param)
/* if there are any non-digits in the 'offset', then treat it as a ident file */
for (scan = argv[4]; *scan != 0; scan++)
- if (!isdigit(*scan))
+ if (!isdigit((UINT8)*scan))
break;
if (*scan != 0)
{
diff --git a/src/tools/jedutil.c b/src/tools/jedutil.c
index 409dc55114c..7baf2d42933 100644
--- a/src/tools/jedutil.c
+++ b/src/tools/jedutil.c
@@ -191,16 +191,16 @@ int main(int argc, char *argv[])
/* does the source end in '.jed'? */
len = strlen(srcfile);
src_is_jed = (srcfile[len - 4] == '.' &&
- tolower(srcfile[len - 3]) == 'j' &&
- tolower(srcfile[len - 2]) == 'e' &&
- tolower(srcfile[len - 1]) == 'd');
+ tolower((UINT8)srcfile[len - 3]) == 'j' &&
+ tolower((UINT8)srcfile[len - 2]) == 'e' &&
+ tolower((UINT8)srcfile[len - 1]) == 'd');
/* does the destination end in '.jed'? */
len = strlen(dstfile);
dst_is_jed = (dstfile[len - 4] == '.' &&
- tolower(dstfile[len - 3]) == 'j' &&
- tolower(dstfile[len - 2]) == 'e' &&
- tolower(dstfile[len - 1]) == 'd');
+ tolower((UINT8)dstfile[len - 3]) == 'j' &&
+ tolower((UINT8)dstfile[len - 2]) == 'e' &&
+ tolower((UINT8)dstfile[len - 1]) == 'd');
/* error if neither or both are .jed */
if (!src_is_jed && !dst_is_jed)
diff --git a/src/tools/ldverify.c b/src/tools/ldverify.c
index 187bea0cefa..c51817c10b2 100644
--- a/src/tools/ldverify.c
+++ b/src/tools/ldverify.c
@@ -680,9 +680,9 @@ int main(int argc, char *argv[])
srcfilelen = strlen(srcfile);
if (srcfilelen < 4)
return usage();
- if (tolower(srcfile[srcfilelen-3]) == 'a' && tolower(srcfile[srcfilelen-2]) == 'v' && tolower(srcfile[srcfilelen-1]) == 'i')
+ if (tolower((UINT8)srcfile[srcfilelen-3]) == 'a' && tolower((UINT8)srcfile[srcfilelen-2]) == 'v' && tolower((UINT8)srcfile[srcfilelen-1]) == 'i')
isavi = TRUE;
- else if (tolower(srcfile[srcfilelen-3]) == 'c' && tolower(srcfile[srcfilelen-2]) == 'h' && tolower(srcfile[srcfilelen-1]) == 'd')
+ else if (tolower((UINT8)srcfile[srcfilelen-3]) == 'c' && tolower((UINT8)srcfile[srcfilelen-2]) == 'h' && tolower((UINT8)srcfile[srcfilelen-1]) == 'd')
isavi = FALSE;
else
return usage();
diff --git a/src/tools/regrep.c b/src/tools/regrep.c
index f5609ede11a..99346ab6d3f 100644
--- a/src/tools/regrep.c
+++ b/src/tools/regrep.c
@@ -177,12 +177,12 @@ INLINE char *trim_string(char *string)
int length;
/* trim leading spaces */
- while (*string != 0 && isspace(*string))
+ while (*string != 0 && isspace((UINT8)*string))
string++;
/* trim trailing spaces */
length = strlen(string);
- while (length > 0 && isspace(string[length - 1]))
+ while (length > 0 && isspace((UINT8)string[length - 1]))
string[--length] = 0;
return string;
@@ -400,7 +400,7 @@ static int read_summary_log(const char *filename, int index)
{
/* find the end of the line and normalize it with a CR */
for (curptr = linestart; *curptr != 0 && *curptr != '\n' && *curptr != '\r'; curptr++)
- if (!isspace(*curptr))
+ if (!isspace((UINT8)*curptr))
foundchars = 1;
*curptr++ = '\n';
*curptr = 0;
@@ -434,7 +434,7 @@ static int read_summary_log(const char *filename, int index)
char *end;
/* find the end */
- for (end = start; !isspace(*end); end++) ;
+ for (end = start; !isspace((UINT8)*end); end++) ;
*end = 0;
strcpy(lists[index].version, start);
fprintf(stderr, "Parsing results from version %s\n", lists[index].version);