mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
lib_strftime: Also fix %l to avoid printing 0:xx AM/PM
This commit is contained in:
committed by
Xiang Xiao
parent
95f131c3c2
commit
9b8eedd218
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user