]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: do not hardcode date command magic string twice
authorSami Kerola <kerolasa@iki.fi>
Sat, 16 Jul 2016 12:23:28 +0000 (13:23 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 4 Feb 2017 23:39:37 +0000 (23:39 +0000)
Variable 'magic' already contains string 'seconds-into-epoch'.

Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/hwclock.c

index 10cb02a50917e3b96180bb5c83d35684b6200508..db1912a607581338065a95f2df1d95eb11f45dd2 100644 (file)
@@ -717,8 +717,8 @@ static int interpret_date_string(const char *date_opt, time_t * const time_p)
                return 12;
        }
 
-       sprintf(date_command, "date --date=\"%s\" +seconds-into-epoch=%%s",
-               date_opt);
+       sprintf(date_command, "date --date=\"%s\" +%s%%s",
+               date_opt, magic);
        if (debug)
                printf(_("Issuing date command: %s\n"), date_command);