shithub: scc

Download patch

ref: d2278660a0bce54ae4a5d37f2fbc6dd4c2f459c8
parent: 3a91086edd50be172bf1f2305967e145d3c4faf8
author: Naveen Narayanan <zerous@simple-cc.org>
date: Sat Aug 29 13:39:12 EDT 2020

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.

--- a/src/libc/time/strftime.c
+++ b/src/libc/time/strftime.c
@@ -25,7 +25,7 @@
 	ny = _newyear(year);
 	if (ny == day)
 		return 0;
-	return 7 - ny + day;
+	return 7 - (ny + day);
 }