summaryrefslogtreecommitdiff
path: root/src/gsmd/ext_response.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gsmd/ext_response.c')
-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