diff --git a/tools/foe_tool/foe_tool.c b/tools/foe_tool/foe_tool.c index 4839cd9..9209484 100644 --- a/tools/foe_tool/foe_tool.c +++ b/tools/foe_tool/foe_tool.c @@ -72,10 +72,11 @@ void no_verbose_log(int lvl, void *user, const char *format, ...) { va_list ap; va_start(ap, format); - if ( (strstr(format, "sending file offset") != NULL) || - (strstr(format, "retrieving file offset") != NULL) ) + vsnprintf(&message[1], 511, format, ap); + + if ( (strstr(&message[1], "sending file offset") != NULL) || + (strstr(&message[1], "retrieving file offset") != NULL) ) { - vsnprintf(&message[1], 511, format, ap); message[0] = '\r'; message[strlen(message)-1] = '\0'; fprintf(stderr, "%s", message); @@ -86,6 +87,7 @@ void no_verbose_log(int lvl, void *user, const char *format, ...) { fprintf(stderr, "\n"); } + va_start(ap, format); vfprintf(stderr, format, ap); } va_end(ap);