summaryrefslogtreecommitdiff
path: root/xconsole.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2006-03-18 18:31:08 +0000
committerMatthieu Herrb <matthieu.herrb@laas.fr>2006-03-18 18:31:08 +0000
commit219ef4e86f05e7a473e399c5188efdb7f16f31f1 (patch)
tree1d6cd296d93c99706a6e86ebafda6d5ab7b4bd79 /xconsole.c
parent950d308b3230e7e89d307fd95abb983e44987665 (diff)
Avoid potential underflow if read() returns -1. Coverity CID 414XORG-7_0_99_901
Diffstat (limited to 'xconsole.c')
-rw-r--r--xconsole.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/xconsole.c b/xconsole.c
index c79d72c..1e2a41a 100644
--- a/xconsole.c
+++ b/xconsole.c
@@ -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