As g_queue_peek_head() returns the node data field, we have to compare
it against the actual command, not against the pointer to the queue node.
---
gatchat/gatchat.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index d82a02e..96da657 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -1060,7 +1060,7 @@ static gboolean at_chat_cancel(struct at_chat *chat, guint group,
guint id)
if (c->gid != group)
return FALSE;
- if (l == g_queue_peek_head(chat->command_queue) &&
+ if (c == g_queue_peek_head(chat->command_queue) &&
chat->cmd_bytes_written > 0) {
/* We can't actually remove it since it is most likely
* already in progress, just null out the callback
--
1.7.3.2