commit d2278660a0bce54ae4a5d37f2fbc6dd4c2f459c8
parent 3a91086edd50be172bf1f2305967e145d3c4faf8
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);
}