summaryrefslogtreecommitdiffstats
path: root/gatchat/gathdlc.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-04-24 19:02:04 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-04-24 19:02:04 +0200
commit057bd9f0b340a307abeec5066190cf8ce982b614 (patch)
tree90c2b860788caa16e525050abc03c30306f2c2db /gatchat/gathdlc.c
parent46839fbd15511867cd3a4ebcd69e4dd3896b1e6d (diff)
downloadofono-057bd9f0b340a307abeec5066190cf8ce982b614.tar.bz2
Fix wrong escape character check in HDLC transmit
Diffstat (limited to 'gatchat/gathdlc.c')
-rw-r--r--gatchat/gathdlc.c4
1 files changed, 2 insertions, 2 deletions
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 {