From 2ceeb7ce58b026a0de6d2df03b9c24d95cca235a Mon Sep 17 00:00:00 2001 From: Arthur David Olson Date: Wed, 25 Dec 1991 12:17:19 -0500 Subject: [PATCH] bww suggestion SCCS-file: zic.c SCCS-SID: 7.3 --- zic.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/zic.c b/zic.c index d22b69d..04e2f4b 100644 --- a/zic.c +++ b/zic.c @@ -999,19 +999,21 @@ const int nfields; register int positive; int count; - positive = FALSE; - count = 1; - if (*cp == '-') - ++cp; - else if (*cp == '+') { - ++cp; + if (strcmp(cp, "") == 0) { /* infile() turns "-" into "" */ + positive = FALSE; + count = 1; + } else if (strcmp(cp, "--") == 0) { + positive = FALSE; + count = 2; + } else if (strcmp(cp, "+") == 0) { positive = TRUE; - } - if (*cp != '\0' && - (sscanf(cp, scheck(cp, "%d"), &count) != 1 || - count <= 0)) { - error("illegal CORRECTION field on Leap line"); - return; + count = 1; + } else if (strcmp(cp, "++") == 0) { + positive = TRUE; + count = 2; + } else { + error("illegal CORRECTION field on Leap line"); + return; } if ((lp = byword(fields[LP_ROLL], leap_types)) == NULL) { error("illegal Rolling/Stationary field on Leap line");