Avoid bug with non-ASCII characters.
authorBruno Haible <bruno@clisp.org>
Tue, 14 Jan 2003 12:39:42 +0000 (12:39 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 14 Jan 2003 12:39:42 +0000 (12:39 +0000)
lib/ChangeLog
lib/readtokens.c

index e9e298133aec7b572118200ddeb2541a53bd187b..7b1cd59869837a42170481ac36f6abfeff45ba9e 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 8ae1e070a2154fff4f67548fc35f990448f3a893..74585a58693570d79821e9ae474b60d6ee32948e 100644 (file)
@@ -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;