From e6c1ec7867446b19b423a14365e1cfad910b6a0d Mon Sep 17 00:00:00 2001 From: tick Date: Tue, 4 Dec 2007 07:24:05 +0000 Subject: gsmd: make extrsp_parse() can take care another input (sean_chiang) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3558 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/gsmd/ext_response.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gsmd') diff --git a/src/gsmd/ext_response.c b/src/gsmd/ext_response.c index 5b31c8d..37edf59 100644 --- a/src/gsmd/ext_response.c +++ b/src/gsmd/ext_response.c @@ -109,16 +109,16 @@ struct gsm_extrsp *extrsp_parse(const void *ctx, const char *input) } break; case TOKEN_NUMERIC: - if (*cur == ',') { + if (isdigit(*cur)) { + *cur_buf = *cur; + cur_buf++; + } + + if (*cur == ',' || *(cur+1) == '\0') { /* end of number */ cur_token->u.numeric = atoi(buf); er->num_tokens++; state = IDLE; - } else if (isdigit(*cur)) { - *cur_buf = *cur; - cur_buf++; - } else { - /* ERORR */ } break; case TOKEN_STRING: -- cgit v1.2.3