From eb949e4a8cede8ef050d63f1f00175e339491881 Mon Sep 17 00:00:00 2001 From: tick Date: Mon, 3 Dec 2007 06:21:28 +0000 Subject: 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 --- src/gsmd/atcmd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gsmd') 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; } -- cgit v1.2.3