1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Fix warning.

Add comment on the use of ??) in C, since that string isn't entirely
obvious to people who are reading the code.
This commit is contained in:
Alexander Færøy 2015-09-20 21:45:33 +02:00
parent be977bf1b7
commit 519955ebe4
No known key found for this signature in database
GPG Key ID: E15081D5D3C3DB53

View File

@ -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,