(print_unicode_char): Cast the second iconv() arg,
authorJim Meyering <jim@meyering.net>
Sun, 21 Jan 2001 09:40:43 +0000 (09:40 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 21 Jan 2001 09:40:43 +0000 (09:40 +0000)
to avoid a warning.  Add back 'const' to inptr.

lib/unicodeio.c

index 2d11db2..2771132 100644 (file)
@@ -158,7 +158,7 @@ print_unicode_char (FILE *stream, unsigned int code)
     {
 #if HAVE_ICONV
       char outbuf[25];
-      char *inptr;
+      const char *inptr;
       size_t inbytesleft;
       char *outptr;
       size_t outbytesleft;
@@ -170,7 +170,9 @@ print_unicode_char (FILE *stream, unsigned int code)
       outbytesleft = sizeof (outbuf);
 
       /* Convert the character from UTF-8 to the locale's charset.  */
-      res = iconv (utf8_to_local, &inptr, &inbytesleft, &outptr, &outbytesleft);
+      res = iconv (utf8_to_local,
+                  (ICONV_CONST char **)&inptr, &inbytesleft,
+                  &outptr, &outbytesleft);
       if (inbytesleft > 0 || res == (size_t)(-1)
          /* Irix iconv() inserts a NUL byte if it cannot convert. */
 # if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)