]> granicus.if.org Git - neomutt/commitdiff
mutt_read_line(): make line counting ptr optional
authorRocco Rutte <pdmef@gmx.net>
Sun, 21 Jun 2009 19:04:43 +0000 (21:04 +0200)
committerRocco Rutte <pdmef@gmx.net>
Sun, 21 Jun 2009 19:04:43 +0000 (21:04 +0200)
lib.c

diff --git a/lib.c b/lib.c
index d43ae6638df71efefc3da3fc455cb48defab0047..92d46cbb05cb288ed73611b8c650ca2001bb6dcb 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -758,7 +758,8 @@ char *mutt_read_line (char *s, size_t *size, FILE *fp, int *line, int flags)
     }
     if ((ch = strchr (s + offset, '\n')) != NULL)
     {
-      (*line)++;
+      if (line)
+       (*line)++;
       if (flags & M_EOL)
        return s;
       *ch = 0;
@@ -779,7 +780,8 @@ char *mutt_read_line (char *s, size_t *size, FILE *fp, int *line, int flags)
       if (c == EOF)
       {
         /* The last line of fp isn't \n terminated */
-        (*line)++;
+       if (line)
+         (*line)++;
         return s;
       }
       else