Netdev List
 help / color / mirror / Atom feed
From: Petr Sabata <contyk@redhat.com>
To: netdev@vger.kernel.org
Cc: Petr Sabata <contyk@redhat.com>
Subject: [PATCH] iproute2: Check getline() return code correctly
Date: Fri, 10 Jun 2011 14:49:27 +0200	[thread overview]
Message-ID: <1307710167-28868-1-git-send-email-contyk@redhat.com> (raw)

The current implementation is always false, no matter what happens.

Signed-off-by: Petr Sabata <contyk@redhat.com>
---
 lib/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/utils.c b/lib/utils.c
index 1b42222..76cadea 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -702,7 +702,7 @@ ssize_t getcmdline(char **linep, size_t *lenp, FILE *in)
 		size_t len1 = 0;
 		size_t cc1;
 
-		if ((cc1 = getline(&line1, &len1, in)) < 0) {
+		if ((cc1 = getline(&line1, &len1, in)) == (size_t)-1) {
 			fprintf(stderr, "Missing continuation line\n");
 			return cc1;
 		}
-- 
1.7.5.2


             reply	other threads:[~2011-06-10 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-10 12:49 Petr Sabata [this message]
2011-07-11 17:37 ` [PATCH] iproute2: Check getline() return code correctly Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307710167-28868-1-git-send-email-contyk@redhat.com \
    --to=contyk@redhat.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox