A couple more Coverity issues fixed

This commit is contained in:
Steve Underwood 2014-05-01 01:19:28 +08:00
parent c37d0dd6f0
commit 32c0bfde6b
3 changed files with 12 additions and 7 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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 --------------------------------------------------------*/