Rename xclone to xmemdup. Remove obsolete xalloc macros.
[gnulib.git] / lib / readtokens.c
index 438441c..9fb611d 100644 (file)
 #include <string.h>
 #include <stdbool.h>
 
-#include "unlocked-io.h"
 #include "xalloc.h"
 
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
 #define STREQ(a,b) ((a) == (b) || ((a) && (b) && *(a) == *(b) \
                                   && strcmp(a, b) == 0))
 
@@ -96,7 +99,10 @@ readtoken (FILE *stream,
       saved_delim = delim;
       memset (isdelim, 0, sizeof isdelim);
       for (j = 0; j < n_delim; j++)
-       isdelim[(unsigned char) delim[j]] = 1;
+       {
+         unsigned char ch = delim[j];
+         isdelim[ch] = 1;
+       }
     }
 
   /* FIXME: don't fool with this caching.  Use strchr instead.  */