aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-27 21:36:44 -0600
committerTom Tromey <tom@tromey.com>2018-10-04 13:40:10 -0600
commit9fdd7193e7fd041e9ff311a69dc02aecef53070f (patch)
treefcc637d9a16616e182d096b2ebd2f684fda7e292 /gdb
parent3f2cf4dcd578d60fcdbbc28e720badffe8c15661 (diff)
downloadgdb-9fdd7193e7fd041e9ff311a69dc02aecef53070f.zip
gdb-9fdd7193e7fd041e9ff311a69dc02aecef53070f.tar.gz
gdb-9fdd7193e7fd041e9ff311a69dc02aecef53070f.tar.bz2
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 <tom@tromey.com> * complaints.c (complaint_internal): Correctly check complaint count.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/complaints.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5ee22e6..14ef35f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2018-10-04 Tom Tromey <tom@tromey.com>
+ * complaints.c (complaint_internal): Correctly check complaint
+ count.
+
+2018-10-04 Tom Tromey <tom@tromey.com>
+
* complaints.h (struct complaints): Remove declaration.
* complaints.c (clear_complaints): Remove an unused variable.
diff --git a/gdb/complaints.c b/gdb/complaints.c
index 03102f1..43ea7a1 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);