summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gatchat/gatchat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index 616f843a..15cc934c 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -466,7 +466,7 @@ static void have_line(GAtChat *p, gboolean strip_preceding)
cmd = g_queue_peek_head(p->command_queue);
- if (cmd) {
+ if (cmd && p->cmd_bytes_written > 0) {
char c = cmd->cmd[p->cmd_bytes_written - 1];
/* We check that we have submitted a terminator, in which case