From 519955ebe4a421e8027c3dd09af9ea76d949d259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Sun, 20 Sep 2015 21:45:33 +0200 Subject: [PATCH] Fix warning. Add comment on the use of ??) in C, since that string isn't entirely obvious to people who are reading the code. --- src/fe-text/statusbar-items.c | 10 +++++++--- 1 file 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,