]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
parse-date: fix printf format
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 12 Jul 2017 19:41:50 +0000 (21:41 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 18 Jul 2017 09:06:52 +0000 (11:06 +0200)
warning on 32bit systems:
../lib/parse-date.y: In function 'parse_date':
../lib/parse-date.y:1509:7: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'intmax_t' [-Wformat=]
       abs_time_zone_min);
       ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
lib/parse-date.y

index 5e966f0c31c4a1c334d299474cd76a272684edd3..bb5abb5d4cf468959be8e567c21bbc91bb3de3c8 100644 (file)
@@ -1503,7 +1503,7 @@ int parse_date(struct timespec *result, char const *p,
 
                                if (!tz_was_altered)
                                        tz0 = get_tz (tz0buf);
-                               sprintf (tz1buf, "XXX%s%ld:%02d",
+                               sprintf (tz1buf, "XXX%s%jd:%02d",
                                         &"-"[time_zone < 0],
                                         abs_time_zone_hour,
                                         abs_time_zone_min);