All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vaughan Cao <vaughan.cao@oracle.com>
To: dm-devel@redhat.com
Cc: vaughan.cao@oracle.com
Subject: [PATCH] dm-multipath: fix get_word return value when the last word is found
Date: Fri, 20 Mar 2015 17:01:54 +0800	[thread overview]
Message-ID: <1426842114-3335-1-git-send-email-vaughan.cao@oracle.com> (raw)

get_word() returns how many bytes it has parsed when it gets a new word.
But the deleted code will cause 0 returned for the last word, which
breaks this semantic. It hasn't cause any trouble yet because we have
been calling it as we are certain there is an word left.

Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
---
 libmultipath/util.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libmultipath/util.c b/libmultipath/util.c
index ac0d1b2..0bb9c15 100644
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -93,9 +93,6 @@ get_word (char * sentence, char ** word)
 	strchop(*word);
 	condlog(4, "*word = %s, len = %i", *word, len);
 
-	if (*p == '\0')
-		return 0;
-
 	return skip + len;
 }
 
-- 
1.9.0

                 reply	other threads:[~2015-03-20  9:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1426842114-3335-1-git-send-email-vaughan.cao@oracle.com \
    --to=vaughan.cao@oracle.com \
    --cc=dm-devel@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.