]> granicus.if.org Git - strace/blobdiff - strace.c
Fix "format not a string literal" warning caused by tprintf(str)
[strace] / strace.c
index 83ebc5b0d51d28812d2ba56d8c7ac51833a0e53f..9c633887265228a6c6c0f00783dba7b5c99e2367 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2646,7 +2646,21 @@ tprintf(const char *fmt, ...)
                        curcol += n;
        }
        va_end(args);
-       return;
+}
+
+void
+tprints(const char *str)
+{
+       if (outf) {
+               int n = fputs(str, outf);
+               if (n >= 0) {
+                       curcol += strlen(str);
+                       return;
+               }
+               if (outf != stderr)
+                       perror(outfname == NULL
+                              ? "<writing to pipe>" : outfname);
+       }
 }
 
 void
@@ -2705,7 +2719,7 @@ void
 tabto(void)
 {
        if (curcol < acolumn)
-               tprintf(acolumn_spaces + curcol);
+               tprints(acolumn_spaces + curcol);
 }
 
 void