From: Olivier Gayot Date: Mon, 11 Jun 2018 22:52:29 +0000 (+0200) Subject: No longer use a temporary buffer in the die() function X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3status;a=commitdiff_plain;h=ca8c3e73372babbf1aaa47db55a9360739ca37c5 No longer use a temporary buffer in the die() function Before the following change f947d0a Breaks configfiles! Major refactoring of i3status, see below The die(fmt, ...) function was outputting the reason to the status bar in addition to stderr. For this reason, it was meaningful to create a temporary string according to the format string and then passing it around to the different functions. Nowadays, we only display the error message to stderr so calling fprintf(stderr, ...) is much simpler. Signed-off-by: Olivier Gayot --- diff --git a/src/general.c b/src/general.c index f299a2b..2424cc6 100644 --- a/src/general.c +++ b/src/general.c @@ -51,12 +51,10 @@ char *skip_character(char *input, char character, int amount) { * */ void die(const char *fmt, ...) { - char buffer[512]; va_list ap; va_start(ap, fmt); - (void)vsnprintf(buffer, sizeof(buffer), fmt, ap); + (void)vfprintf(stderr, fmt, ap); va_end(ap); - fprintf(stderr, "%s", buffer); exit(EXIT_FAILURE); }