diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2006-03-18 18:31:08 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2006-03-18 18:31:08 +0000 |
commit | 219ef4e86f05e7a473e399c5188efdb7f16f31f1 (patch) | |
tree | 1d6cd296d93c99706a6e86ebafda6d5ab7b4bd79 /xconsole.c | |
parent | 950d308b3230e7e89d307fd95abb983e44987665 (diff) |
Avoid potential underflow if read() returns -1. Coverity CID 414XORG-7_0_99_901
Diffstat (limited to 'xconsole.c')
-rw-r--r-- | xconsole.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -516,17 +516,17 @@ inputReady(XtPointer w, int *source, XtInputId *id) { OpenConsole(); } - - } - Notify (); - buffer[n] = '\0'; - if (app_resources.stripNonprint) - { - stripNonprint (buffer); - n = strlen (buffer); + } else { + Notify(); + buffer[n] = '\0'; + if (app_resources.stripNonprint) + { + stripNonprint (buffer); + n = strlen (buffer); + } + + TextAppend ((Widget) text, buffer, n); } - - TextAppend ((Widget) text, buffer, n); } static Boolean |