PR ld/12613
authorAlan Modra <amodra@gmail.com>
Tue, 29 Mar 2011 02:52:36 +0000 (02:52 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 29 Mar 2011 02:52:36 +0000 (02:52 +0000)
* ldlex.l (lex_warn_invalid): Don't assume char is unsigned.

ld/ChangeLog
ld/ldlex.l

index bcfd3016db93be40c7dd7d835276f9d1ba849baa..e41fc137d8bef0c71565a548af9b24c3ef0aeafc 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-29  Alan Modra  <amodra@gmail.com>
+
+       PR ld/12613
+       * ldlex.l (lex_warn_invalid): Don't assume char is unsigned.
+
 2011-03-26  John Marino  <binutils@marino.st>
 
        * configure.host: Update *-*-dragonfly* host entry.
index a1c954837a0fde2c9e95cf16f1dd5501088ff30d..013c07e473afa49044779c0aeee34809152eb499 100644 (file)
@@ -689,7 +689,7 @@ lex_warn_invalid (char *where, char *what)
 
   if (! ISPRINT (*what))
     {
-      sprintf (buf, "\\%03o", (unsigned int) *what);
+      sprintf (buf, "\\%03o", *(unsigned char *) what);
       what = buf;
     }