From: Alejandro Colomar Date: Mon, 29 Jan 2024 14:14:29 +0000 (+0100) Subject: lib/time/day_to_str.h: DAY_TO_STR(): Add macro X-Git-Tag: 4.15.1~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19edb06fd2e4efe7f431b57ff9e7f05265e6fb16;p=thirdparty%2Fshadow.git lib/time/day_to_str.h: DAY_TO_STR(): Add macro This macro ensures that the buffer is an array, and calculates the size. Signed-off-by: Alejandro Colomar --- diff --git a/lib/time/day_to_str.h b/lib/time/day_to_str.h index 65601c96d..2689794ba 100644 --- a/lib/time/day_to_str.h +++ b/lib/time/day_to_str.h @@ -12,9 +12,14 @@ #include +#include "defines.h" +#include "sizeof.h" #include "string/strtcpy.h" +#define DAY_TO_STR(str, day) date_to_str(NITEMS(str), str, day * DAY) + + inline void date_to_str(size_t size, char buf[size], long date);