]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_scan.c
Fix invalid pointer arithmetic.
[nmh] / sbr / fmt_scan.c
index 075b7dd6db3e944a5c1a1e4c14feb41a7d5ca3f5..791146a21a83203925743d1791b40bc247dafe52 100644 (file)
@@ -31,7 +31,7 @@ struct mailname fmt_mnull = { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0,
 /*
  * static prototypes
  */
-static int match (char *, char *);
+static int match (char *, char *) PURE;
 static char *get_x400_friendly (char *, char *, int);
 static int get_x400_comp (char *, char *, char *, int);
 
@@ -841,7 +841,7 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
        case FT_LV_RCLOCK:
            if ((value = fmt->f_comp->c_tws->tw_clock) == 0)
                value = dmktime(fmt->f_comp->c_tws);
-           value = time((time_t *) 0) - value;
+           value = time(NULL) - value;
            break;
        case FT_LV_DAYF:
            if (!(((tws = fmt->f_comp->c_tws)->tw_flags) & (TW_SEXP|TW_SIMP)))
@@ -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;
@@ -1206,5 +1206,5 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
        }
     }
 
-    return (NULL);
+    return NULL;
 }