aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-09-24 01:26:08 +0200
committerMattias Andrée <maandree@kth.se>2017-09-24 01:31:31 +0200
commitbcac04b4316d64063e743e7a49195173a0c175a0 (patch)
treefc29431d21d83e4496da31d32f4f441de41026be /src/util.c
parentFix colour distortion (diff)
downloadblind-bcac04b4316d64063e743e7a49195173a0c175a0.tar.gz
blind-bcac04b4316d64063e743e7a49195173a0c175a0.tar.bz2
blind-bcac04b4316d64063e743e7a49195173a0c175a0.tar.xz
Add -% to blind-to-text, blind-colour-srgb, and blind-colour-ciexyz
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 41d8104..1f0da6a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -6,6 +6,7 @@ char *argv0;
void
weprintf(const char *fmt, ...)
{
+ char end;
va_list ap;
va_start(ap, fmt);
@@ -14,9 +15,12 @@ weprintf(const char *fmt, ...)
vfprintf(stderr, fmt, ap);
- if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
+ end = *fmt ? strchr(fmt, '\0')[-1] : '\n';
+ if (end == ':') {
fputc(' ', stderr);
perror(NULL);
+ } else if (end != '\n') {
+ fputc('\n', stderr);
}
va_end(ap);