Skip to content

Commit

Permalink
lib/time/day_to_str.h: DAY_TO_STR(): Add macro
Browse files Browse the repository at this point in the history
This macro ensures that the buffer is an array, and calculates the size.

Signed-off-by: Alejandro Colomar <[email protected]>
  • Loading branch information
alejandro-colomar authored and hallyn committed Mar 14, 2024
1 parent be05c62 commit 19edb06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/time/day_to_str.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@

#include <time.h>

#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);


Expand Down

0 comments on commit 19edb06

Please sign in to comment.