* strace.c (vtprintf): New function. (tprintf): Use it. --- strace.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/strace.c b/strace.c index 7214e6e..2b50cc0 100644 --- a/strace.c +++ b/strace.c @@ -569,12 +569,9 @@ strace_popen(const char *command) return fp; } -void -tprintf(const char *fmt, ...) +static void +vtprintf(const char *fmt, va_list args) { - va_list args; - - va_start(args, fmt); if (current_tcp) { int n = vfprintf(current_tcp->outf, fmt, args); if (n < 0) { @@ -583,6 +580,15 @@ tprintf(const char *fmt, ...) } else current_tcp->curcol += n; } +} + +void +tprintf(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + vtprintf(fmt, args); va_end(args); } -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel