]> granicus.if.org Git - recode/commitdiff
Jim on gcc warnings
authorFrançois Pinard <pinard@iro.umontreal.ca>
Tue, 18 Mar 2008 14:06:58 +0000 (10:06 -0400)
committerFrançois Pinard <pinard@iro.umontreal.ca>
Tue, 18 Mar 2008 14:06:58 +0000 (10:06 -0400)
src/ChangeLog
src/iconv.c
src/names.c

index 2e651dbaf697e00594738ef2bfa707fc93a11036..82bc8134a68c313d85c7411d8f6aef0e8d50d68f 100644 (file)
@@ -1,3 +1,12 @@
+2008-03-17  Jim Meyering  <meyering@redhat.com>
+
+       Avoid gcc warning about ambiguous `else'.
+       * iconv.c (wrapped_transform): Add braces.
+
+       Avoid a warning from gcc -Wformat-security.
+       * names.c (list_concise_charset): Use fputs to print spaces,
+       not printf.
+
 2008-03-16  François Pinard  <pinard@iro.umontreal.ca>
 
        * recodext.h.in: New name for recodext.h.
index 13950176bc83921c59a7502a269fd44afa7e93ca..a16c10f728449487f7405fd6c8e9e13050051507 100644 (file)
@@ -98,28 +98,30 @@ wrapped_transform (iconv_t conversion, RECODE_SUBTASK subtask)
 
       drain_first = false;
       if (saved_errno != 0 && saved_errno != E2BIG)
-        if (saved_errno == EILSEQ)
-          {
-            /* Invalid input.  Skip one byte.  */
-            RETURN_IF_NOGO (RECODE_INVALID_INPUT, subtask);
-            assert (input_left > 0);
-            input++;
-            input_left--;
-            /* Why is draining required?  */
-            drain_first = true;
-          }
-        else if (saved_errno == EINVAL)
-          {
-            if (input + input_left < input_buffer + BUFFER_SIZE
-                && input_char == EOF)
-              /* Incomplete multibyte sequence at end of input.  */
-              RETURN_IF_NOGO (RECODE_INVALID_INPUT, subtask);
-          }
-        else
-          {
-            recode_perror (subtask->task->request->outer, "iconv ()");
-            RETURN_IF_NOGO (RECODE_SYSTEM_ERROR, subtask);
-          }
+       {
+         if (saved_errno == EILSEQ)
+           {
+             /* Invalid input.  Skip one byte.  */
+             RETURN_IF_NOGO (RECODE_INVALID_INPUT, subtask);
+             assert (input_left > 0);
+             input++;
+             input_left--;
+             /* Why is draining required?  */
+             drain_first = true;
+           }
+         else if (saved_errno == EINVAL)
+           {
+             if (input + input_left < input_buffer + BUFFER_SIZE
+                 && input_char == EOF)
+               /* Incomplete multibyte sequence at end of input.  */
+               RETURN_IF_NOGO (RECODE_INVALID_INPUT, subtask);
+           }
+         else
+           {
+             recode_perror (subtask->task->request->outer, "iconv ()");
+             RETURN_IF_NOGO (RECODE_SYSTEM_ERROR, subtask);
+           }
+       }
 
       /* Move back any unprocessed part of the input buffer.  */
       for (cursor = input_buffer; input_left != 0; input_left--)
index f01c3c4faf3bdd251b66e99712894e66f8a9e80b..bf94bf443d4224036f82ac0e606edb3c3b258d05 100644 (file)
@@ -919,7 +919,7 @@ list_concise_charset (RECODE_OUTER outer,
            if (ucs2 >= 0)
              printf (format, code);
            else if (mnemonic || counter2 != 112)
-             printf (blanks);
+             fputs (blanks,  stdout);
 
            if (mnemonic)
              printf (counter2 == 112 ? " %s\n" : " %-3s", mnemonic);