From 9fdd7193e7fd041e9ff311a69dc02aecef53070f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 27 May 2018 21:36:44 -0600 Subject: [PATCH] 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. --- gdb/ChangeLog | 5 +++++ gdb/complaints.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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); -- 2.30.2