From a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:52:39 +0200 Subject: format files --- src/myctime.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/myctime.c') diff --git a/src/myctime.c b/src/myctime.c index 6f554c9..ebb01ba 100644 --- a/src/myctime.c +++ b/src/myctime.c @@ -1,13 +1,12 @@ -#include "datetime.h" -#include "fmt.h" #include "myctime.h" -static char *daytab[7] = { -"Sun","Mon","Tue","Wed","Thu","Fri","Sat" -}; +#include "fmt.h" + +#include "datetime.h" + +static char *daytab[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static char *montab[12] = { -"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" -}; + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; static char result[30]; @@ -15,21 +14,21 @@ char *myctime(datetime_sec t) { struct datetime dt; unsigned int len; - datetime_tai(&dt,t); + datetime_tai(&dt, t); len = 0; - len += fmt_str(result + len,daytab[dt.wday]); + len += fmt_str(result + len, daytab[dt.wday]); result[len++] = ' '; - len += fmt_str(result + len,montab[dt.mon]); + len += fmt_str(result + len, montab[dt.mon]); result[len++] = ' '; - len += fmt_uint0(result + len,dt.mday,2); + len += fmt_uint0(result + len, dt.mday, 2); result[len++] = ' '; - len += fmt_uint0(result + len,dt.hour,2); + len += fmt_uint0(result + len, dt.hour, 2); result[len++] = ':'; - len += fmt_uint0(result + len,dt.min,2); + len += fmt_uint0(result + len, dt.min, 2); result[len++] = ':'; - len += fmt_uint0(result + len,dt.sec,2); + len += fmt_uint0(result + len, dt.sec, 2); result[len++] = ' '; - len += fmt_uint(result + len,1900 + dt.year); + len += fmt_uint(result + len, 1900 + dt.year); result[len++] = '\n'; result[len++] = 0; return result; -- cgit v1.2.3