From 4109810199738fa410a696a2a16900ce0fa42eae Mon Sep 17 00:00:00 2001 From: wiire-a Date: Wed, 15 Nov 2017 13:09:25 +0100 Subject: [PATCH] Print program version on stdout All the other information is still printed on stderr. The idea to print them on separate streams was to make it easier from wrappers to get the version discarding all the other information, however this was never the case until now. --- src/pixiewps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pixiewps.c b/src/pixiewps.c index 6e5cf29..31f3c4a 100644 --- a/src/pixiewps.c +++ b/src/pixiewps.c @@ -351,10 +351,12 @@ memory_err: r_time = t_current.tv_sec; ts = *gmtime(&r_time); strftime(buffer, 30, "%c", &ts); - fprintf(stderr, "\n Pixiewps %s\n\n" + fprintf(stderr, "\n "); + printf("Pixiewps %s", LONG_VERSION); fflush(stdout); + fprintf(stderr, "\n\n" " [*] System time: %lu (%s UTC)\n" " [*] Number of cores available: %u\n\n", - LONG_VERSION, (unsigned long) t_current.tv_sec, buffer, cores == 0 ? 1 : cores); + (unsigned long) t_current.tv_sec, buffer, cores == 0 ? 1 : cores); free(wps->error); free(wps); return ARG_ERROR;