From 057bd9f0b340a307abeec5066190cf8ce982b614 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 24 Apr 2010 19:02:04 +0200 Subject: Fix wrong escape character check in HDLC transmit --- gatchat/gathdlc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gatchat/gathdlc.c') diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c index 1c2c3c53..8ad66784 100644 --- a/gatchat/gathdlc.c +++ b/gatchat/gathdlc.c @@ -336,7 +336,7 @@ gboolean g_at_hdlc_send(GAtHDLC *hdlc, const unsigned char *data, gsize size) fcs = HDLC_FCS(fcs, data[i]); *buf = data[i++] ^ HDLC_TRANS; escape = FALSE; - } else if (*buf == HDLC_FLAG || *buf == HDLC_ESCAPE) { + } else if (data[i] == HDLC_FLAG || data[i] == HDLC_ESCAPE) { *buf = HDLC_ESCAPE; escape = TRUE; } else { @@ -365,7 +365,7 @@ gboolean g_at_hdlc_send(GAtHDLC *hdlc, const unsigned char *data, gsize size) if (escape == TRUE) { *buf = tail[i++] ^ HDLC_TRANS; escape = FALSE; - } else if (*buf == HDLC_FLAG || *buf == HDLC_ESCAPE) { + } else if (tail[i] == HDLC_FLAG || tail[i] == HDLC_ESCAPE) { *buf = HDLC_ESCAPE; escape = TRUE; } else { -- cgit v1.2.3