From ca8c3e73372babbf1aaa47db55a9360739ca37c5 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 12 Jun 2018 00:52:29 +0200 Subject: 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 --- src/general.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/general.c') 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); } -- cgit v1.2.3