summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-04 07:24:05 +0000
committertick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-04 07:24:05 +0000
commite6c1ec7867446b19b423a14365e1cfad910b6a0d (patch)
tree59d906330c56fa1cade2d120082856c2f77378a7
parentc30754e2f07d987fa60950bad385261f1144471e (diff)
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
-rw-r--r--src/gsmd/ext_response.c12
1 files changed, 6 insertions, 6 deletions
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:
personal git repositories of Harald Welte. Your mileage may vary