mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 14:25:56 +00:00
cmd: date: Do not overwrite arguments
Arguments are const and belong to the caller. Calling date in a hush loop will yield different results from the second invocation. Signed-off-by: Roman Kapl <rka@sysgo.com>
This commit is contained in:
parent
957f51e863
commit
44ac80e7e9
1 changed files with 4 additions and 4 deletions
|
@ -166,11 +166,11 @@ int mk_date (const char *datestr, struct rtc_time *tmp)
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
int sec;
|
int sec;
|
||||||
|
|
||||||
*ptr++ = '\0';
|
ptr++;
|
||||||
if ((len - (ptr - datestr)) != 2)
|
if ((len - (ptr - datestr)) != 2)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
len = strlen (datestr);
|
len -= 3;
|
||||||
|
|
||||||
if (cnvrt2 (ptr, &sec))
|
if (cnvrt2 (ptr, &sec))
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue