Fix "format not a string literal" warning caused by tprintf(str)
* defs.h: Declare tprints().
* strace.c: Define tprints().
(tabto): Use tprints(str), since tprintf(str) was throwing a warning.
* desc.c: Use tprints(str) instead of tprintf("%s", str).
* file.c: Likewise.
* io.c: Likewise.
* net.c: Likewise.
* process.c: Likewise.
* signal.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
diff --git a/strace.c b/strace.c
index 83ebc5b..9c63388 100644
--- a/strace.c
+++ b/strace.c
@@ -2646,7 +2646,21 @@
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 @@
tabto(void)
{
if (curcol < acolumn)
- tprintf(acolumn_spaces + curcol);
+ tprints(acolumn_spaces + curcol);
}
void