]> diplodocus.org Git - nmh/blobdiff - sbr/seq_list.c
Replace `a == b ? 1 : 0' and similar with `a == b'.
[nmh] / sbr / seq_list.c
index 268c25944792a1a98e1d614c4dd9f21a2af9190e..c456428108faa6aa338200a9ac3d40aa67cb20b7 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * seq_list.c -- Get all messages in a sequence and return them
+/* seq_list.c -- Get all messages in a sequence and return them
  *            -- as a space separated list of message ranges.
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
@@ -41,8 +39,8 @@ seq_list(struct msgs *mp, char *seqname)
        if (mp->curmsg) {       
            snprintf(buffer, len, "%s", m_name(mp->curmsg));
            return (buffer);
-       } else
-           return (NULL);
+       }
+        return (NULL);
     }
 
     /* If the folder is empty, just return NULL */
@@ -85,7 +83,7 @@ seq_list(struct msgs *mp, char *seqname)
        if (bp > buffer)
            *bp++ = ' ';
 
-       sprintf(bp, "%s", m_name(i));
+       strcpy(bp, m_name(i));
        bp += strlen(bp);
        j = i;                  /* Remember beginning of message range */
 
@@ -97,7 +95,8 @@ seq_list(struct msgs *mp, char *seqname)
            ;
 
        if (i - j > 1) {
-           sprintf(bp, "-%s", m_name(i - 1));
+            *bp++ = '-';
+           strcpy(bp, m_name(i - 1));
            bp += strlen(bp);
        }
     }