From: Tom Tromey Date: Mon, 28 May 2018 03:36:44 +0000 (-0600) Subject: Fix off-by-one error in complaint_internal X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fdd7193e7fd041e9ff311a69dc02aecef53070f;p=binutils-gdb.git Fix off-by-one error in complaint_internal complaint_internal had an off-by-one error, where it would allow one extra complaint to be issued. gdb/ChangeLog 2018-10-04 Tom Tromey * complaints.c (complaint_internal): Correctly check complaint count. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5ee22e6d237..14ef35f68a0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-10-04 Tom Tromey + + * complaints.c (complaint_internal): Correctly check complaint + count. + 2018-10-04 Tom Tromey * complaints.h (struct complaints): Remove declaration. diff --git a/gdb/complaints.c b/gdb/complaints.c index 03102f13ab3..43ea7a18a73 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -56,7 +56,7 @@ complaint_internal (const char *fmt, ...) { va_list args; - if (counters[fmt]++ > stop_whining) + if (++counters[fmt] > stop_whining) return; va_start (args, fmt);