Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964807AbZLGQ54 (ORCPT ); Mon, 7 Dec 2009 11:57:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S935481AbZLGQ5x (ORCPT ); Mon, 7 Dec 2009 11:57:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17008 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935482AbZLGQ5v (ORCPT ); Mon, 7 Dec 2009 11:57:51 -0500 From: Masami Hiramatsu Subject: [BUGFIX PATCH -tip 2/5] perf probe: Fix strtailcmp() to compare s1[0] and s2[0] To: Ingo Molnar , Frederic Weisbecker , lkml Cc: systemtap , DLE , "Juha Leppanen" , Masami Hiramatsu Date: Mon, 07 Dec 2009 12:00:40 -0500 Message-ID: <20091207170040.19230.37464.stgit@dhcp-100-2-132.bos.redhat.com> In-Reply-To: <20091207170027.19230.39491.stgit@dhcp-100-2-132.bos.redhat.com> References: <20091207170027.19230.39491.stgit@dhcp-100-2-132.bos.redhat.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1284 Lines: 42 From: Juha Leppanen 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" Reported-by: "Juha Leppanen" Acked-by: Masami Hiramatsu --- 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]; } -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/