]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR27722, error: array subscript has type char
authorAlan Modra <amodra@gmail.com>
Tue, 13 Apr 2021 06:30:10 +0000 (16:00 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 13 Apr 2021 06:44:20 +0000 (16:14 +0930)
PR 27722
* libdep_plugin.c (str2vec): Don't pass a potentially signed char
to isspace.

ld/ChangeLog
ld/libdep_plugin.c

index c862e8b13aee70221f63d591104f63c6362c08dd..e7620ce0417ced45be7d9edeb51269eefc51cfe3 100644 (file)
@@ -1,3 +1,9 @@
+2021-04-13  Alan Modra  <amodra@gmail.com>
+
+       PR 27722
+       * libdep_plugin.c (str2vec): Don't pass a potentially signed char
+       to isspace.
+
 2021-04-12  Alan Modra  <amodra@gmail.com>
 
        * configure.ac (--enable-checking): Add support.
index 7c108e4de8d128dbe726192d953c2d38c9102e0f..5130c6f664bfbe01bc7d8e4a7f3d78bdf1758d86 100644 (file)
@@ -139,7 +139,7 @@ str2vec (char *in)
 
   end = in + strlen (in);
   s = in;
-  while (isspace (*s)) s++;
+  while (isspace ((unsigned char) *s)) s++;
   first = s;
 
   i = 1;
@@ -163,12 +163,12 @@ str2vec (char *in)
          memmove (s, s+1, end-s-1);
          end--;
        }
-      if (isspace (*s))
+      if (isspace ((unsigned char) *s))
        {
          if (sq || dq)
            continue;
          *s++ = '\0';
-         while (isspace (*s)) s++;
+         while (isspace ((unsigned char) *s)) s++;
          if (*s)
            res[++i] = s;
        }