This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/7] Fix off-by-one error in complaint_internal
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Sun, 23 Sep 2018 09:09:52 -0600
- Subject: [PATCH 2/7] Fix off-by-one error in complaint_internal
- References: <20180923150957.5798-1-tom@tromey.com>
complaint_internal had an off-by-one error, where it would allow one
extra complaint to be issued.
gdb/ChangeLog
2018-09-23 Tom Tromey <tom@tromey.com>
* 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/complaints.c b/gdb/complaints.c
index 03102f13ab..43ea7a18a7 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.17.1