X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f28cfc5260eb87df0f6f106c837b3e2de640a9bf..4829d096feb337a55e2b866adb19acab9617b071:/uip/new.c diff --git a/uip/new.c b/uip/new.c index b18a99b3..0dee3c37 100644 --- a/uip/new.c +++ b/uip/new.c @@ -73,13 +73,13 @@ count_messages(char *field) { int total = 0; int j, k; - char *cp, **ap; field = getcpy(field); /* copied from seq_read.c:seq_init */ - for (ap = brkstring (field, " ", "\n"); *ap; ap++) { - if ((cp = strchr(*ap, '-'))) + for (char *const *ap = brkstring (field, " ", "\n"); *ap; ap++) { + char *cp = strchr(*ap, '-'); + if (cp != NULL) *cp++ = '\0'; if ((j = m_atoi (*ap)) > 0) { k = cp ? m_atoi (cp) : j; @@ -135,7 +135,7 @@ get_msgnums(char *folder, char *sequences[]) seqfile = concat(m_maildir(folder), "/", mh_seq, NULL); if (seqfile == NULL) - return NULL; + return NULL; if ((fp = lkfopendata (seqfile, "r", & failed_to_lock)) == NULL) { if (failed_to_lock) @@ -453,7 +453,7 @@ doit(char *cur, char *folders, char *sequences[]) int main(int argc, char **argv) { - char **ap, *cp, **argp, **arguments; + char *cp, **argp, **arguments; char help[BUFSIZ]; char *folders = NULL; svector_t sequences = svector_create (0); @@ -527,7 +527,7 @@ main(int argc, char **argv) if (unseen == NULL || unseen[0] == '\0') { die("must specify sequences or set %s", usequence); } - for (ap = brkstring(unseen, " ", "\n"); *ap; ap++) { + for (char *const *ap = brkstring(unseen, " ", "\n"); *ap; ap++) { svector_push_back (sequences, *ap); ++i; }