summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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) {