summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-01-14 12:39:42 +0000
committerBruno Haible <bruno@clisp.org>2003-01-14 12:39:42 +0000
commit40ea7eb653ee5210733a9c5abe0d4a5fd52bc703 (patch)
tree1c4f0674441a81bb7f97ef9b5c6e5af6798f3a9e
parentab352daed97372060cc038c30f2b6394d8ff1c54 (diff)
downloadgnulib-40ea7eb653ee5210733a9c5abe0d4a5fd52bc703.tar.gz
Avoid bug with non-ASCII characters.
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/readtokens.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index e9e298133a..7b1cd59869 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,5 +1,10 @@
2003-01-11 Bruno Haible <bruno@clisp.org>
+ * readtokens.c (readtoken): Cast character to 'unsigned char', not
+ 'unsigned int'.
+
+2003-01-11 Bruno Haible <bruno@clisp.org>
+
* hash-pjw.c: Add comment about low quality of this function.
2003-01-12 Paul Eggert <eggert@twinsun.com>
diff --git a/lib/readtokens.c b/lib/readtokens.c
index 8ae1e070a2..74585a5869 100644
--- a/lib/readtokens.c
+++ b/lib/readtokens.c
@@ -1,5 +1,5 @@
/* readtokens.c -- Functions for reading tokens from an input stream.
- Copyright (C) 1990-1991, 1999, 2001 Jim Meyering.
+ Copyright (C) 1990-1991, 1999, 2001, 2003 Jim Meyering.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -113,7 +113,7 @@ readtoken (FILE *stream,
for (j = 0; j < sizeof (isdelim); j++)
isdelim[j] = 0;
for (t = delim; *t; t++)
- isdelim[(unsigned int) *t] = 1;
+ isdelim[(unsigned char) *t] = 1;
}
p = tokenbuffer->buffer;