X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbasic%2Ftime-util.h;h=ef49343a8211e964341959cb5b86a56d9823f20b;hp=a0c850b08386b23c8a6527e223f1c44bc357350b;hb=dfc15f0ea42513f256e636ee78991e637b67be34;hpb=3b22396a4b2767a98172f6915929c47738cb0a1e diff --git a/src/basic/time-util.h b/src/basic/time-util.h index a0c850b08..ef49343a8 100644 --- a/src/basic/time-util.h +++ b/src/basic/time-util.h @@ -112,6 +112,8 @@ int parse_sec(const char *t, usec_t *usec); // UNNEEDED clockid_t clock_boottime_or_monotonic(void); -#define xstrftime(buf, fmt, tm) assert_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0) +#define xstrftime(buf, fmt, tm) \ + assert_message_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0, \ + "xstrftime: " #buf "[] must be big enough") // UNNEEDED int get_timezone(char **timezone);