changeset 2042:45d9db50d996

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 30 Nov 2018 06:52:46 +0200
parents 493d79ea50a8
children cbb3463fea2a
files tools/fanalyze.c
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tools/fanalyze.c	Fri Nov 30 06:52:32 2018 +0200
+++ b/tools/fanalyze.c	Fri Nov 30 06:52:46 2018 +0200
@@ -477,30 +477,32 @@
             {
                 DMSourceFile *file = &srcFiles[nfile];
                 Uint32 mval;
-                char mfmt[32];
+                char mstr[32];
                 int npad, nwidth;
 
                 if (dmGetData(node->type, file, node->value, &mval))
                 {
-                    snprintf(mfmt, sizeof(mfmt), "%%0%dx", def->bsize * 2);
+                    char mfmt[16];
                     nwidth = def->bsize * 2;
+                    snprintf(mfmt, sizeof(mfmt), "%%0%dx", nwidth);
+                    snprintf(mstr, sizeof(mstr), mfmt, mval);
                 }
                 else
                 {
-                    strcpy(mfmt, "----");
+                    strcpy(mstr, "----");
                     nwidth = 4;
                 }
 
                 npad = (10 - nwidth) / 2;
                 for (int q = 0; q < npad; q++)
-                    putchar(' ');
-                    
-                printf(mfmt, mval);
+                    fputc(' ', stdout);
+
+                fputs(mstr, stdout);
 
                 for (int q = 0; q < npad; q++)
-                    putchar(' ');
+                    fputc(' ', stdout);
             }
-            printf("\n");
+            fputs("\n", stdout);
         }
     }
     else