diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-12-01 23:53:13 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-12-01 23:53:13 +0000 |
commit | fcd791c4ba187976703dd37821366d4d5e41e0f4 (patch) | |
tree | 6bcd0bc8486f01b08bdb37dd9102189723241073 | |
parent | af1c602f8f460da363a4e70dd0d36ae7958673c7 (diff) | |
download | fetchmail-fcd791c4ba187976703dd37821366d4d5e41e0f4.tar.gz fetchmail-fcd791c4ba187976703dd37821366d4d5e41e0f4.tar.bz2 fetchmail-fcd791c4ba187976703dd37821366d4d5e41e0f4.zip |
Improved netrc parsing.
svn path=/trunk/; revision=2255
-rw-r--r-- | netrc.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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; |