From: planet36 Date: Thu, 25 Mar 2021 17:05:48 +0000 (-0400) Subject: uptime: Use sizeof instead of repeating the size X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=40f13be551f0e1a0eaee07dcb64b3b6ab3a68dd9;p=suckless%2Fslstatus.git uptime: Use sizeof instead of repeating the size Signed-off-by: drkhsh --- diff --git a/components/uptime.c b/components/uptime.c index d97e5e8..6227f73 100644 --- a/components/uptime.c +++ b/components/uptime.c @@ -22,7 +22,7 @@ uptime(const char *unused) struct timespec uptime; if (clock_gettime(UPTIME_FLAG, &uptime) < 0) { - snprintf(warn_buf, 256, "clock_gettime %d", UPTIME_FLAG); + snprintf(warn_buf, sizeof(warn_buf), "clock_gettime %d", UPTIME_FLAG); warn(warn_buf); return NULL; }