summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@0x90.dk>2015-09-20 21:45:33 +0200
committerAlexander Færøy <ahf@0x90.dk>2015-09-20 21:45:33 +0200
commit519955ebe4a421e8027c3dd09af9ea76d949d259 (patch)
tree4f26f9978690bc0d544606985a1bad943bfdd476 /src
parentbe977bf1b795c93dbff4fa52f04b5d425a3f3648 (diff)
downloadirssi-519955ebe4a421e8027c3dd09af9ea76d949d259.zip
Fix warning.
Add comment on the use of ??) in C, since that string isn't entirely obvious to people who are reading the code.
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/statusbar-items.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c
index 044c2fa0..e3e0c2a6 100644
--- a/src/fe-text/statusbar-items.c
+++ b/src/fe-text/statusbar-items.c
@@ -347,10 +347,14 @@ static void item_lag(SBAR_ITEM_REC *item, int get_size_only)
last_lag_unknown = lag_unknown;
if (lag_unknown) {
- g_snprintf(str, sizeof(str), "%d (?""?)", lag/100);
+ // "??)" in C becomes ']'
+ // See: https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C
+ g_snprintf(str, sizeof(str), "%d (?""?)", lag / 100);
} else {
- g_snprintf(str, sizeof(str),
- lag%100 == 0 ? "%d" : "%d.%02d", lag/100, lag%100);
+ if (lag % 100 == 0)
+ g_snprintf(str, sizeof(str), "%d", lag / 100);
+ else
+ g_snprintf(str, sizeof(str), "%d.%02d", lag / 100, lag % 100);
}
statusbar_item_default_handler(item, get_size_only,