aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-12-01 23:53:13 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-12-01 23:53:13 +0000
commitfcd791c4ba187976703dd37821366d4d5e41e0f4 (patch)
tree6bcd0bc8486f01b08bdb37dd9102189723241073
parentaf1c602f8f460da363a4e70dd0d36ae7958673c7 (diff)
downloadfetchmail-fcd791c4ba187976703dd37821366d4d5e41e0f4.tar.gz
fetchmail-fcd791c4ba187976703dd37821366d4d5e41e0f4.tar.bz2
fetchmail-fcd791c4ba187976703dd37821366d4d5e41e0f4.zip
Improved netrc parsing.
svn path=/trunk/; revision=2255
-rw-r--r--netrc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/netrc.c b/netrc.c
index a5263c41..3d20ae97 100644
--- 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;