lib_strftime: Also fix %l to avoid printing 0:xx AM/PM

This commit is contained in:
Alan Carvalho de Assis
2023-06-20 21:36:48 -03:00
committed by Xiang Xiao
parent 95f131c3c2
commit 9b8eedd218
+2 -1
View File
@@ -305,7 +305,8 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
case 'l':
{
len = snprintf(dest, chleft, "%2d", tm->tm_hour % 12);
len = snprintf(dest, chleft, "%2d", (tm->tm_hour % 12) != 0 ?
(tm->tm_hour % 12) : 12);
}
break;