commit a3dde947d63b686ac8c8582557704d444b0b9e8c
parent 112057b0a1b3a504ac31a05b4a3e30bcdbde385e
Author: Naveen Narayanan <zerous@simple-cc.org>
Date: Sat, 29 Aug 2020 17:39:12 +0200
libc: Fix first() (strftime)
first() returns the date of the first respective day (arg) of the year
by subtracting the sum of newyear and the respective day from 7.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libc/time/strftime.c b/src/libc/time/strftime.c
@@ -25,7 +25,7 @@ first(int day, int year)
ny = _newyear(year);
if (ny == day)
return 0;
- return 7 - ny + day;
+ return 7 - (ny + day);
}