X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c6f2d14d9c38345075629af3487c2de491584ca1..4e8e2c96547bfe72589982a85fac450df4cf6d08:/uip/dropsbr.c diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 6f7f3652..baf8268b 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -210,7 +210,7 @@ mbx_read (FILE *fp, long pos, struct drop **drops) } if (dp == pp) - free ((char *) pp); + free(pp); else *drops = pp; return (dp - pp); @@ -350,7 +350,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, * Change the "Return-Path:" field (if in first line) * back to "From ". */ - if (!strncmp (buffer, "Return-Path:", 12)) { + if (has_prefix(buffer, "Return-Path:")) { char tmpbuffer[BUFSIZ]; char *tp, *ep, *fp; @@ -361,7 +361,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, tp = dctime(dlocaltimenow()); snprintf (buffer, sizeof(buffer), "From %.*s %s", (int)(fp - ep), ep, tp); - } else if (!strncmp (buffer, "X-Envelope-From:", 16)) { + } else if (has_prefix(buffer, "X-Envelope-From:")) { /* * Change the "X-Envelope-From:" field * (if first line) back to "From ". @@ -372,7 +372,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, strncpy(tmpbuffer, buffer, sizeof(tmpbuffer)); ep = tmpbuffer + 17; snprintf (buffer, sizeof(buffer), "From %s", ep); - } else if (strncmp (buffer, "From ", 5)) { + } else if (!has_prefix(buffer, "From ")) { /* * If there is already a "From " line, * then leave it alone. Else we add one. @@ -391,7 +391,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, * If this is not first line, and begins with * "From ", then prepend line with ">". */ - if (j != 0 && strncmp (buffer, "From ", 5) == 0) { + if (j != 0 && has_prefix(buffer, "From ")) { if (write (md, ">", 1) < 0) { advise (mailbox, "write"); } @@ -507,7 +507,7 @@ map_read (char *file, long pos, struct drop **drops, int noisy) if ((i = read (md, (char *) (dp + 1), msgp * sizeof(*dp))) < (int) sizeof(*dp)) { i = 0; - free ((char *) dp); + free(dp); } else { #ifdef NTOHLSWAP struct drop *tdp; @@ -591,7 +591,7 @@ map_write (char *mailbox, int md, int id, long last, off_t start, return NOTOK; } } - free ((char *) rp); + free(rp); fclose (fp); break; }