Fix unchecked return value
authorColin Leroy <colin@colino.net>
Thu, 8 Oct 2015 17:13:17 +0000 (19:13 +0200)
committerColin Leroy <colin@colino.net>
Thu, 8 Oct 2015 17:13:17 +0000 (19:13 +0200)
src/compose.c

index 285158f163ee0622e3356776f6edc16901a267a2..ed92268122df1c84c43ecc1cec53e32e65132ac4 100644 (file)
@@ -9443,7 +9443,10 @@ static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
 
        debug_print("Compose: input from monitoring process\n");
 
-       g_io_channel_read_chars(source, buf, sizeof(buf), &bytes_read, NULL);
+       if (g_io_channel_read_chars(source, buf, sizeof(buf), &bytes_read, NULL) != G_IO_STATUS_NORMAL) {
+               bytes_read = 0;
+               buf[0] = '\0';
+       }
 
        g_io_channel_shutdown(source, FALSE, NULL);
        g_io_channel_unref(source);