summaryrefslogtreecommitdiff
path: root/cmd/date.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/date.c')
-rw-r--r--cmd/date.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/date.c b/cmd/date.c
index 1115b6c8d6..7fa950a902 100644
--- a/cmd/date.c
+++ b/cmd/date.c
@@ -159,18 +159,18 @@ int mk_date (const char *datestr, struct rtc_time *tmp)
int len, val;
char *ptr;
- ptr = strchr (datestr,'.');
- len = strlen (datestr);
+ ptr = strchr(datestr, '.');
+ len = strlen(datestr);
/* Set seconds */
if (ptr) {
int sec;
- *ptr++ = '\0';
+ ptr++;
if ((len - (ptr - datestr)) != 2)
return (-1);
- len = strlen (datestr);
+ len -= 3;
if (cnvrt2 (ptr, &sec))
return (-1);