monitor: assert monitor_puts()'s loop invariant
authorMarkus Armbruster <armbru@redhat.com>
Thu, 10 Jan 2013 13:10:22 +0000 (14:10 +0100)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 10 Jan 2013 16:47:56 +0000 (14:47 -0200)
Chiefly to hush up Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor.c

index 9cf419bb1d458ccb13e4a411d63ae21e84f6fc6e..c6eac608a3abc94b70f859fb876a2bc98c8d0b29 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -270,6 +270,7 @@ static void monitor_puts(Monitor *mon, const char *str)
     char c;
 
     for(;;) {
+        assert(mon->outbuf_index < sizeof(mon->outbuf) - 1);
         c = *str++;
         if (c == '\0')
             break;