]> diplodocus.org Git - nmh/blobdiff - uip/fmtdump.c
Silence more gcc format-string warnings.
[nmh] / uip / fmtdump.c
index a3eec4059a11eb66ad458c6465dd9340be5da624..55d7dcc7f3f5961a6ddfcfa6f0f0f2a9995507ad 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * fmtdump.c -- compile format file and dump out instructions
+/* fmtdump.c -- compile format file and dump out instructions
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -11,6 +9,7 @@
 #include <h/fmt_scan.h>
 #include <h/fmt_compile.h>
 #include <h/scansbr.h>
+#include <h/utils.h>
 
 #define FMTDUMP_SWITCHES \
     X("form formatfile", 0, FORMSW) \
@@ -266,6 +265,7 @@ dumpone(struct format *fmt)
        case FT_IF_MATCH:
        case FT_IF_AMATCH:
                printf(" continue else goto");
+               /* FALLTHRU */
        case FT_GOTO:
                i = findlabel(fmt + fmt->f_skip);
                printf(" L%d", i);
@@ -420,9 +420,7 @@ f_typestr(int t)
        case FT_GETMYMBOX: return("GETMYMBOX");
        case FT_GETMYADDR: return("GETMYADDR");
        case FT_SAVESTR: return("SAVESTR");
-#ifdef FT_PAUSE
        case FT_PAUSE: return ("PAUSE");
-#endif
        case FT_DONE: return("DONE");
        case FT_NOP: return("NOP");
        case FT_GOTO: return("GOTO");
@@ -441,7 +439,7 @@ f_typestr(int t)
        case FT_V_MATCH: return("V_MATCH");
        case FT_V_AMATCH: return("V_AMATCH");
        default:
-               printf(buf, "/* ??? #%d */", t);
+                snprintf(buf, sizeof buf, "/* ??? #%d */", t);
                return(buf);
        }
 }
@@ -459,7 +457,7 @@ c_typestr(int t)
 
        buf[0] = '\0';
        if (t & ~(CT_ADDR|CT_DATE))
-               printf(buf, "0x%x ", t);
+                snprintf(buf, sizeof buf, "0x%x ", t);
        strcat(buf, "<");
        i = 0;
        FNORD(CT_ADDR, "ADDR");
@@ -476,7 +474,7 @@ c_flagsstr(int t)
 
        buf[0] = '\0';
        if (t & ~(CF_TRUE|CF_PARSED|CF_DATEFAB|CF_TRIMMED))
-               printf(buf, "0x%x ", t);
+                snprintf(buf, sizeof buf, "0x%x ", t);
        strcat(buf, "<");
        i = 0;
        FNORD(CF_TRUE, "TRUE");