From 54844078771050588f277ee111487f892f5b7129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valmantas=20Palik=C5=A1a?= Date: Mon, 18 Mar 2019 08:04:40 -0600 Subject: [PATCH] nshlib/nsh_timcmds.c: Initialized struct tm cause 'date -s' to fail. --- nshlib/nsh_timcmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nshlib/nsh_timcmds.c b/nshlib/nsh_timcmds.c index 1004c667d..bbfb7138a 100644 --- a/nshlib/nsh_timcmds.c +++ b/nshlib/nsh_timcmds.c @@ -1,7 +1,7 @@ /**************************************************************************** * apps/nshlib/dbg_timcmds.c * - * Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2014, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -166,6 +166,8 @@ static inline int date_settime(FAR struct nsh_vtbl_s *vtbl, FAR const char *name long result; int ret; + memset(&tm, 0, sizeof(tm)); + /* Only this date format is supported: MMM DD HH:MM:SS YYYY */ /* Get the month abbreviation */