From 32c0bfde6b2a75314f6d13f3d927b4eb88bfa063 Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Thu, 1 May 2014 01:19:28 +0800 Subject: [PATCH] A couple more Coverity issues fixed --- libs/spandsp/src/at_interpreter.c | 15 +++++++++++---- libs/spandsp/src/t43.c | 2 +- libs/spandsp/src/v42.c | 2 -- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libs/spandsp/src/at_interpreter.c b/libs/spandsp/src/at_interpreter.c index dbe490badd..c009a19a52 100644 --- a/libs/spandsp/src/at_interpreter.c +++ b/libs/spandsp/src/at_interpreter.c @@ -726,11 +726,18 @@ static int parse_string_list_out(at_state_t *s, const char **t, int *target, int val = (target) ? *target : 0; while (val-- && (def = strchr(def, ','))) def++; - if ((tmp = strchr(def, ','))) - len = tmp - def; + if (def) + { + if ((tmp = strchr(def, ','))) + len = tmp - def; + else + len = strlen(def); + snprintf(buf, sizeof(buf), "%s%.*s", (prefix) ? prefix : "", (int) len, def); + } else - len = strlen(def); - snprintf(buf, sizeof(buf), "%s%.*s", (prefix) ? prefix : "", (int) len, def); + { + buf[0] = '\0'; + } at_put_response(s, buf); break; default: diff --git a/libs/spandsp/src/t43.c b/libs/spandsp/src/t43.c index 13b19a146f..8735bd01ff 100644 --- a/libs/spandsp/src/t43.c +++ b/libs/spandsp/src/t43.c @@ -381,7 +381,7 @@ SPAN_DECLARE(int) t43_encode_free(t43_encode_state_t *s) { int ret; - t85_encode_free(&s->t85); + t85_encode_release(&s->t85); ret = t43_encode_release(s); span_free(s); return ret; diff --git a/libs/spandsp/src/v42.c b/libs/spandsp/src/v42.c index c52a9676a2..388f69e66f 100644 --- a/libs/spandsp/src/v42.c +++ b/libs/spandsp/src/v42.c @@ -1099,8 +1099,6 @@ SPAN_DECLARE_NONSTD(void) lapm_receive(void *user_data, const uint8_t *frame, in else rx_unnumbered_rsp_frame(ss, frame, len); break; - default: - break; } } /*- End of function --------------------------------------------------------*/