Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time change %ld to %jd



details:   https://anonhg.NetBSD.org/src/rev/e9c06e594b15
branches:  trunk
changeset: 785280:e9c06e594b15
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 06 18:21:18 2013 +0000

description:
change %ld to %jd

diffstat:

 lib/libc/time/zic.c |  14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diffs (47 lines):

diff -r fbcd77ffaf33 -r e9c06e594b15 lib/libc/time/zic.c
--- a/lib/libc/time/zic.c       Wed Mar 06 18:19:07 2013 +0000
+++ b/lib/libc/time/zic.c       Wed Mar 06 18:21:18 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zic.c,v 1.38 2013/03/06 18:19:07 christos Exp $        */
+/*     $NetBSD: zic.c,v 1.39 2013/03/06 18:21:18 christos Exp $        */
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -10,7 +10,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: zic.c,v 1.38 2013/03/06 18:19:07 christos Exp $");
+__RCSID("$NetBSD: zic.c,v 1.39 2013/03/06 18:21:18 christos Exp $");
 #endif /* !defined lint */
 
 #include "version.h"
@@ -869,7 +869,6 @@
 static zic_t
 gethms(const char *string, const char *const errstring, const int signable)
 {
-       long    lhh;
        zic_t   hh;
        int     mm, ss, sign;
 
@@ -881,16 +880,15 @@
                sign = -1;
                ++string;
        } else  sign = 1;
-       if (sscanf(string, scheck(string, "%ld"), &lhh) == 1)
+       if (sscanf(string, scheck(string, "%jd"), &hh) == 1)
                mm = ss = 0;
-       else if (sscanf(string, scheck(string, "%ld:%d"), &lhh, &mm) == 2)
+       else if (sscanf(string, scheck(string, "%jd:%d"), &hh, &mm) == 2)
                ss = 0;
-       else if (sscanf(string, scheck(string, "%ld:%d:%d"),
-               &lhh, &mm, &ss) != 3) {
+       else if (sscanf(string, scheck(string, "%jd:%d:%d"),
+               &hh, &mm, &ss) != 3) {
                        error(errstring);
                        return 0;
        }
-       hh = lhh;
        if (hh < 0 ||
                mm < 0 || mm >= MINSPERHOUR ||
                ss < 0 || ss > SECSPERMIN) {



Home | Main Index | Thread Index | Old Index