summaryrefslogtreecommitdiff
path: root/gcc/dbgcnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dbgcnt.c')
-rw-r--r--gcc/dbgcnt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/dbgcnt.c b/gcc/dbgcnt.c
index 859aabff9d9..0c496b308d6 100644
--- a/gcc/dbgcnt.c
+++ b/gcc/dbgcnt.c
@@ -82,7 +82,8 @@ dbg_cnt_set_limit_by_name (const char *name, int len, int value)
{
int i;
for (i = debug_counter_number_of_counters - 1; i >= 0; i--)
- if (!strncmp (map[i].name, name, len))
+ if (strncmp (map[i].name, name, len) == 0
+ && map[i].name[len] == '\0')
break;
if (i < 0)