summaryrefslogtreecommitdiffstats
path: root/commands/hwclock.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/hwclock.c')
-rw-r--r--commands/hwclock.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/commands/hwclock.c b/commands/hwclock.c
index 1b5c2cd100..c594e070ac 100644
--- a/commands/hwclock.c
+++ b/commands/hwclock.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
#include <common.h>
#include <command.h>
#include <getopt.h>
@@ -9,14 +11,6 @@
#include <string.h>
#include <environment.h>
-static char *strchrnul(const char *s, int c)
-{
- while (*s != '\0' && *s != c)
- s++;
-
- return (char *)s;
-}
-
static int sscanf_two_digits(char *s, int *res)
{
char buf[3];
@@ -159,11 +153,9 @@ static int do_hwclock(int argc, char *argv[])
if (env_name) {
unsigned long time;
- char t[12];
rtc_tm_to_time(&tm, &time);
- snprintf(t, 12, "%lu", time);
- setenv(env_name, t);
+ pr_setenv(env_name, "%lu", time);
} else {
printf("%s\n", time_str(&tm));
}