perf target: Fix check on buffer size
authorNamhyung Kim <namhyung.kim@lge.com>
Thu, 26 Jul 2012 01:50:10 +0000 (10:50 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 1 Aug 2012 21:42:54 +0000 (18:42 -0300)
It was a mistake just replace assert to BUG_ON since its condition
should be negated. Fix it.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ulrich Drepper <drepper@gmail.com>
Link: http://lkml.kernel.org/r/1343267410-7758-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/target.c

index 3f59c496e64c9035311389fb73e9468fb47e7889..051eaa68095e75a61b82aac4c479cf4c8101ef71 100644 (file)
@@ -110,7 +110,7 @@ int perf_target__strerror(struct perf_target *target, int errnum,
        int idx;
        const char *msg;
 
-       BUG_ON(buflen > 0);
+       BUG_ON(buflen == 0);
 
        if (errnum >= 0) {
                const char *err = strerror_r(errnum, buf, buflen);