]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_scan.c
Reformat else-if that are split over two or more lines into one.
[nmh] / sbr / fmt_scan.c
index 50d7c4ca47f438a2f9a807104be861aad92855cd..49fc717f020865b2cdadec567c86b506d5c6b2c5 100644 (file)
@@ -72,8 +72,8 @@ cpnumber(charstring_t dest, int num, int wid, char fill, size_t max) {
     if (wid == 0)
        return;
     if (wid < 0)
-       wid = -wid;
-    if (wid < (num >= 0 ? max : max-1)) {
+        wid = -wid; /* OK because wid originally a short. */
+    if ((size_t)wid < (num >= 0 ? max : max-1)) {
        /* Build up the string representation of num in reverse. */
        charstring_t rev = charstring_create (0);
        int i = num >= 0 ? num : -num;
@@ -989,7 +989,7 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
                *comp->c_tws = *tws;
                comp->c_flags &= ~CF_TRUE;
            } else if ((comp->c_flags & CF_DATEFAB) == 0) {
-               memset (comp->c_tws, 0, sizeof *comp->c_tws);
+               ZERO(comp->c_tws);
                comp->c_flags = CF_TRUE;
            }
            comp->c_flags |= CF_PARSED;