summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-06-15 18:59:21 +0100
committerRobin Watts <robin.watts@artifex.com>2012-06-15 18:59:21 +0100
commit2c066db347b817f6b32b32d1364de4f985864b7c (patch)
treeb9087b43fbf4147f11cf50ddbc6ce4a30d8b3ba6 /apps
parent1d41f3d4c70ded5b64b64a05d82635ec8f7adcb7 (diff)
downloadmupdf-2c066db347b817f6b32b32d1364de4f985864b7c.tar.xz
Fix binary handling in mujstest
When encountering top bit set chars in script files, behave well.
Diffstat (limited to 'apps')
-rw-r--r--apps/jstest_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/jstest_main.c b/apps/jstest_main.c
index 7f2a123d..ed884a9a 100644
--- a/apps/jstest_main.c
+++ b/apps/jstest_main.c
@@ -133,7 +133,7 @@ usage(void)
static char *
getline(FILE *file)
{
- char c;
+ int c;
char *d = getline_buffer;
/* Skip over any prefix of whitespace */
@@ -148,7 +148,7 @@ getline(FILE *file)
do
{
- *d++ = c;
+ *d++ = (char)c;
c = fgetc(file);
}
while (c >= 32);
@@ -166,7 +166,7 @@ match(char **line, const char *match)
if (s == NULL)
return 0;
- while (isspace(*s))
+ while (isspace(*(unsigned char *)s))
s++;
while (*s == *match)
@@ -179,7 +179,7 @@ match(char **line, const char *match)
return 0;
/* We matched! Skip over any whitespace */
- while (isspace(*s))
+ while (isspace(*(unsigned char *)s))
s++;
*line = s;
@@ -190,7 +190,7 @@ match(char **line, const char *match)
s++;
/* Run back until we find where we started, or non whitespace */
- while (s != *line && isspace(s[-1]))
+ while (s != *line && isspace((unsigned char)s[-1]))
s--;
/* Remove the suffix of whitespace */