nshlib: Remove format variable from date_showtime

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-02-15 16:24:01 +08:00 committed by Xiang Xiao
parent 4cc0c755bf
commit 0b722cc864

View File

@ -91,7 +91,6 @@ static inline int date_month(FAR const char *abbrev)
static inline int date_showtime(FAR struct nsh_vtbl_s *vtbl,
FAR const char *name, bool utc)
{
static const char format[] = "%a, %b %d %H:%M:%S %Y";
struct timespec ts;
struct tm tm;
char timbuf[MAX_TIME_STRING];
@ -127,7 +126,7 @@ static inline int date_showtime(FAR struct nsh_vtbl_s *vtbl,
/* Show the current time in the requested format */
ret = strftime(timbuf, MAX_TIME_STRING, format, &tm);
ret = strftime(timbuf, MAX_TIME_STRING, "%a, %b %d %H:%M:%S %Y", &tm);
if (ret < 0)
{
nsh_error(vtbl, g_fmtcmdfailed, name, "strftime", NSH_ERRNO);