]> diplodocus.org Git - nmh/blobdiff - uip/picksbr.c
Replace add(foo, NULL) with mh_xstrdup(foo).
[nmh] / uip / picksbr.c
index ca330b966646c86454ed3e2dfccddcc3232ffd8e..90025abd8a740141da91cfa4b1257d97b9e18065 100644 (file)
@@ -116,7 +116,7 @@ static unsigned char cc[] = {
 #define        pinform         if (!talked++) inform
 
 struct nexus {
-    int (*n_action)();
+    int (*n_action)(struct nexus *n, FILE *fp, int msgnum, long start, long stop);
 
     union {
        /* for {OR,AND,NOT}action */
@@ -180,7 +180,7 @@ static struct nexus *parse(void);
 static struct nexus *nexp1(void);
 static struct nexus *nexp2(void);
 static struct nexus *nexp3(void);
-static struct nexus *newnexus(int (*)(struct nexus *n,
+static struct nexus *newnexus(int (*action)(struct nexus *n,
     FILE *fp, int msgnum, long start, long stop));
 
 static int ORaction(struct nexus *n, FILE *fp, int msgnum,
@@ -519,8 +519,7 @@ PRaction (struct nexus *n, int level)
                dasctime (&n->n_tws, TW_NULL));
        return;
     }
-    fprintf (stderr, "UNKNOWN(0x%x)\n",
-            (unsigned int)(unsigned long) (*n->n_action));
+    fprintf(stderr, "UNKNOWN(%#llx)\n", (unsigned long long)n->n_action);
 }
 
 
@@ -925,20 +924,21 @@ TWSaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
     char *bp;
     char buf[NMH_BUFSIZ], name[NAMESZ];
     struct tws *tw;
-    m_getfld_state_t gstate = 0;
+    m_getfld_state_t gstate;
     NMH_UNUSED (stop);
 
     fseek (fp, start, SEEK_SET);
+    gstate = m_getfld_state_init(fp);
     for (bp = NULL;;) {
        int bufsz = sizeof buf;
-       switch (state = m_getfld (&gstate, name, buf, &bufsz, fp)) {
+       switch (state = m_getfld2(&gstate, name, buf, &bufsz)) {
            case FLD: 
            case FLDPLUS: 
                 mh_xfree(bp);
                bp = mh_xstrdup(buf);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
-                   state = m_getfld (&gstate, name, buf, &bufsz, fp);
+                   state = m_getfld2(&gstate, name, buf, &bufsz);
                    bp = add (buf, bp);
                }
                if (!strcasecmp (name, n->n_datef))