From fcd791c4ba187976703dd37821366d4d5e41e0f4 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 1 Dec 1998 23:53:13 +0000 Subject: Improved netrc parsing. svn path=/trunk/; revision=2255 --- netrc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'netrc.c') 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; -- cgit v1.2.3