diff options
| author | kj_sh604 | 2025-10-18 01:56:51 -0400 |
|---|---|---|
| committer | kj_sh604 | 2025-10-18 01:56:58 -0400 |
| commit | 5e425f8212cf7e4ca9351c8357fd8404ff96a27d (patch) | |
| tree | fa8a25d2e37a5695bbeb1e933359bfbaa0dbd47f /.local/src/dmenu-dunst/util.c | |
| parent | b6ee28ddb4fbea0bfa9371cdf77d79f69e0f26f3 (diff) | |
refactor: update dmenu source
Diffstat (limited to '.local/src/dmenu-dunst/util.c')
| -rw-r--r-- | .local/src/dmenu-dunst/util.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/.local/src/dmenu-dunst/util.c b/.local/src/dmenu-dunst/util.c index 96b82c9..8e26a51 100644 --- a/.local/src/dmenu-dunst/util.c +++ b/.local/src/dmenu-dunst/util.c @@ -1,4 +1,5 @@ /* See LICENSE file for copyright and license details. */ +#include <errno.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -10,17 +11,17 @@ void die(const char *fmt, ...) { va_list ap; + int saved_errno; + + saved_errno = errno; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } + if (fmt[0] && fmt[strlen(fmt)-1] == ':') + fprintf(stderr, " %s", strerror(saved_errno)); + fputc('\n', stderr); exit(1); } |
