]> Pileus Git - ~andy/fetchmail/commitdiff
Improved netrc parsing.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 1 Dec 1998 23:53:13 +0000 (23:53 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 1 Dec 1998 23:53:13 +0000 (23:53 -0000)
svn path=/trunk/; revision=2255

netrc.c

diff --git a/netrc.c b/netrc.c
index a5263c417091c3301627fb2f2472c49721e3b7f3..3d20ae973d698dcb7c6980bb6eb5004a85fc3a9e 100644 (file)
--- a/netrc.c
+++ b/netrc.c
@@ -115,12 +115,11 @@ parse_netrc (file)
     /* While there are lines in the file... */
     while (fgets(buf, POPBUFSIZE, fp))
     {
-       ln ++;
+       ln++;
 
        /* Strip trailing CRLF */
-       p = buf + strlen(buf) - 1;
-       while ((p > buf) && *p && isspace(*p))
-           *p-- = '\0';
+       for (p = buf + strlen(buf) - 1; (p >= buf) && isspace(*p); p--)
+           *p = '\0';
 
        /* Parse the line. */
        p = buf;