From 19edb06fd2e4efe7f431b57ff9e7f05265e6fb16 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 29 Jan 2024 15:14:29 +0100 Subject: [PATCH] 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 --- lib/time/day_to_str.h | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.47.2