Fix off-by-one error in complaint_internal
authorTom Tromey <tom@tromey.com>
Mon, 28 May 2018 03:36:44 +0000 (21:36 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 4 Oct 2018 19:40:10 +0000 (13:40 -0600)
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.

gdb/ChangeLog
gdb/complaints.c

index 5ee22e6d2373bacebbc4cba06abc4972ba73d000..14ef35f68a0f42884267b961006e21d37ebaf08c 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 03102f13ab3d2d14a6b3e409ae16b7fb0137c3fe..43ea7a18a7386ddd1a03da6e026018760b8e86cf 100644 (file)
@@ -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);