summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-03 06:21:28 +0000
committertick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-03 06:21:28 +0000
commiteb949e4a8cede8ef050d63f1f00175e339491881 (patch)
tree41e11785a5b582bb3e6fa0b0c661103221e3f13f
parentbd81bb31faa9922fb8578fcbe294df0498f0195e (diff)
gsmd: Without clearing mlbuf, when get multi-line response, extrsp_parse will be failed. because the garbage data left from the last time(line). (Sean Chiang)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3549 99fdad57-331a-0410-800a-d7fa5415bdb3
-rw-r--r--src/gsmd/atcmd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c
index 4dc430f..371dbb5 100644
--- a/src/gsmd/atcmd.c
+++ b/src/gsmd/atcmd.c
@@ -231,6 +231,7 @@ static int atcmd_done(struct gsmd *g, struct gsmd_atcmd *cmd, const char *buf)
}
rc = cmd->cb(cmd, cmd->ctx, cmd->resp);
DEBUGP("Clearing mlbuf\n");
+ memset(g->mlbuf, 0, MLPARSE_BUF_SIZE);
g->mlbuf_len = 0;
}
@@ -371,6 +372,7 @@ static int ml_parse(const char *buf, int len, void *ctx)
cmd->resp = g->mlbuf;
rc = cmd->cb(cmd, cmd->ctx, cmd->resp);
DEBUGP("Clearing mlbuf\n");
+ memset(g->mlbuf, 0, MLPARSE_BUF_SIZE);
}
g->mlbuf_len = 0;
}
personal git repositories of Harald Welte. Your mileage may vary