(readtoken): Declare an index to be of type unsigned
[gnulib.git] / lib / readtokens.c
index f66bd21..8ae1e07 100644 (file)
@@ -1,5 +1,5 @@
 /* readtokens.c  -- Functions for reading tokens from an input stream.
-   Copyright (C) 1990-1991, 1999 Jim Meyering.
+   Copyright (C) 1990-1991, 1999, 2001 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
@@ -49,8 +49,8 @@
 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
 
 #include "readtokens.h"
-void *xmalloc ();
-void *xrealloc ();
+#include "unlocked-io.h"
+#include "xalloc.h"
 
 #define STREQ(a,b) ((a) == (b) || ((a) && (b) && *(a) == *(b) \
                                   && strcmp(a, b) == 0))
@@ -108,9 +108,10 @@ readtoken (FILE *stream,
   if (!same_delimiters)
     {
       const char *t;
+      unsigned int j;
       saved_delim = delim;
-      for (i = 0; i < sizeof (isdelim); i++)
-       isdelim[i] = 0;
+      for (j = 0; j < sizeof (isdelim); j++)
+       isdelim[j] = 0;
       for (t = delim; *t; t++)
        isdelim[(unsigned int) *t] = 1;
     }