aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot2018-06-12 00:52:29 +0200
committerOlivier Gayot2018-06-20 11:01:59 +0200
commitca8c3e73372babbf1aaa47db55a9360739ca37c5 (patch)
tree36437322d9bbb7df6af846f89eda0fff8b4c4304
parentMerge pull request #289 from bebehei/testsuite (diff)
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 <olivier.gayot@sigexec.com>
-rw-r--r--src/general.c4
1 files changed, 1 insertions, 3 deletions
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);
}