]> diplodocus.org Git - nmh/blobdiff - uip/new.c
expect this commit to be force-replaced periodically
[nmh] / uip / new.c
index b18a99b3f9c5930ce199d417e2edb939a1296327..0dee3c37fa13a4d65b6513c79004629dda6d668c 100644 (file)
--- 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;
        }