summaryrefslogtreecommitdiffstats
path: root/clock.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-06 16:48:54 +0200
committerMattias Andrée <maandree@kth.se>2021-04-06 16:48:54 +0200
commit32fe735311bccb1a0cfe53cab9c07888c6e71690 (patch)
tree476b6d0f766100e2643b96615c3ffcac9d6a74dc /clock.c
parentBegin working on checklist (diff)
downloadpdatools-32fe735311bccb1a0cfe53cab9c07888c6e71690.tar.gz
pdatools-32fe735311bccb1a0cfe53cab9c07888c6e71690.tar.bz2
pdatools-32fe735311bccb1a0cfe53cab9c07888c6e71690.tar.xz
Silence warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--clock.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clock.c b/clock.c
index e4a8ce2..0fb8647 100644
--- a/clock.c
+++ b/clock.c
@@ -140,6 +140,12 @@ display_clock(int timerfd)
now->tm_sec += leap_insert = 1;
}
+#if defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wformat-nonliteral"
+# pragma GCC diagnostic ignored "-Wformat-truncation"
+#endif
+
strftime(week, sizeof(week), week_fmt, now);
len1 = snprintf(line1, sizeof(line1), "%i-(%02i)%.3s-%02i", now->tm_year + 1900,
now->tm_mon + 1, &months[(size_t)now->tm_mon % 12 * 3], now->tm_mday);
@@ -147,6 +153,10 @@ display_clock(int timerfd)
&weekdays[(size_t)now->tm_mday % 7 * 3], week, tzname[now->tm_isdst]);
len3 = snprintf(line3, sizeof(line3), "(@%ji%s)", (intmax_t)timex.time.tv_sec, leap_insert ? "+1" : "");
+#if defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
+
printf("\033[H");
if (x >= 6 * LARGE_X + 2 * LARGE_XC && y > LARGE_Y + 1) {