libc: fix localtime() for December
This commit is contained in:
parent
b5754538ec
commit
b1f7295d48
@ -22,6 +22,8 @@ static int day_of_week(long seconds) {
|
||||
|
||||
static long days_in_month(int month, int year) {
|
||||
switch(month) {
|
||||
case 12:
|
||||
return 31;
|
||||
case 11:
|
||||
return 30;
|
||||
case 10:
|
||||
|
@ -37,6 +37,9 @@ static char * months_short[] = {
|
||||
};
|
||||
|
||||
size_t strftime(char *s, size_t max, const char *fmt, const struct tm *tm) {
|
||||
if (!tm) {
|
||||
return sprintf(s, "[tm is null]");
|
||||
}
|
||||
char * b = s;
|
||||
size_t count = 0;
|
||||
for (const char *f = fmt; *f; f++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user