public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Juha Leppanen <juha_motorsportcom@luukku.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	juha_motorsportcom@luukku.com, dle-develop@lists.sourceforge.net,
	fweisbec@gmail.com, tglx@linutronix.de, mhiramat@redhat.com,
	mingo@elte.hu, systemtap@sources.redhat.com
Subject: [tip:perf/urgent] perf probe: Fix strtailcmp() to compare s1and s2[0]
Date: Mon, 7 Dec 2009 17:36:50 GMT	[thread overview]
Message-ID: <tip-d56728b8d7fb3e1e5e5f97b88fdf6b43a35b4f5e@git.kernel.org> (raw)
In-Reply-To: <20091207170040.19230.37464.stgit@dhcp-100-2-132.bos.redhat.com>

Commit-ID:  d56728b8d7fb3e1e5e5f97b88fdf6b43a35b4f5e
Gitweb:     http://git.kernel.org/tip/d56728b8d7fb3e1e5e5f97b88fdf6b43a35b4f5e
Author:     Juha Leppanen <juha_motorsportcom@luukku.com>
AuthorDate: Mon, 7 Dec 2009 12:00:40 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 7 Dec 2009 18:33:20 +0100

perf probe: Fix strtailcmp() to compare s1and s2[0]

Fix strtailcmp() to compare s1[0] and s2[0]. strtailcmp() returns 0
if "a" and "b" or "a" and "ab", it's a wrong behavior. This patch
fixes it.

Signed-off-by: "Juha Leppanen" <juha_motorsportcom@luukku.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Juha Leppanen <juha_motorsportcom@luukku.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091207170040.19230.37464.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/util/probe-finder.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 293cdfc..4585f1d 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -106,7 +106,7 @@ static int strtailcmp(const char *s1, const char *s2)
 {
 	int i1 = strlen(s1);
 	int i2 = strlen(s2);
-	while (--i1 > 0 && --i2 > 0) {
+	while (--i1 >= 0 && --i2 >= 0) {
 		if (s1[i1] != s2[i2])
 			return s1[i1] - s2[i2];
 	}

  reply	other threads:[~2009-12-07 17:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 17:00 [BUGFIX PATCH -tip 0/5] perf-probe/x86 insn decoder bugfixes Masami Hiramatsu
2009-12-07 17:00 ` [BUGFIX PATCH -tip 1/5] x86 insn: Delete empty or incomplete inat-tables.c Masami Hiramatsu
2009-12-07 17:36   ` [tip:perf/urgent] " tip-bot for Masami Hiramatsu
2009-12-07 17:00 ` [BUGFIX PATCH -tip 2/5] perf probe: Fix strtailcmp() to compare s1[0] and s2[0] Masami Hiramatsu
2009-12-07 17:36   ` tip-bot for Juha Leppanen [this message]
2009-12-07 17:00 ` [BUGFIX PATCH -tip 3/5] perf probe: Fix event namelist to duplicate string Masami Hiramatsu
2009-12-07 17:37   ` [tip:perf/urgent] " tip-bot for Masami Hiramatsu
2009-12-07 17:00 ` [BUGFIX PATCH -tip 4/5] perf probe: Check e_snprintf() format string Masami Hiramatsu
2009-12-07 17:37   ` [tip:perf/urgent] " tip-bot for Masami Hiramatsu
2009-12-07 17:00 ` [BUGFIX PATCH -tip 5/5] perf probe: Use pr_debug for debug message Masami Hiramatsu
2009-12-07 17:37   ` [tip:perf/urgent] " tip-bot for Masami Hiramatsu

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=tip-d56728b8d7fb3e1e5e5f97b88fdf6b43a35b4f5e@git.kernel.org \
    --to=juha_motorsportcom@luukku.com \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=systemtap@sources.redhat.com \
    --cc=tglx@linutronix.de \
    /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