From: liuchao Date: Wed, 4 Jan 2017 02:46:06 +0000 (+0800) Subject: Fix an inappropriate sscanf return value judgment X-Git-Tag: android-x86-8.1-r1~196^2~19^2~42^2~93 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0e42408b91;p=android-x86%2Fsystem-bt.git Fix an inappropriate sscanf return value judgment This fixes an inappropriate sscanf return value judgment that res check here is not needed while res2 is the one that need to be checked Test: mm -j 8 Change-Id: I3e332286c9434d5b9d01421f5f421039f84ad6c7 --- diff --git a/bta/hf_client/bta_hf_client_at.cc b/bta/hf_client/bta_hf_client_at.cc index e6a7923e6..8bd55ed42 100644 --- a/bta/hf_client/bta_hf_client_at.cc +++ b/bta/hf_client/bta_hf_client_at.cc @@ -1246,7 +1246,7 @@ static char* bta_hf_client_parse_clcc(tBTA_HF_CLIENT_CB* client_cb, if (res2 == 0) { res2 = sscanf(buffer, ",\"\",%hu%n", &type, &offset); - if (res < 0) return NULL; + if (res2 < 0) return NULL; /* numstr is not matched in second attempt, correct this */ res2++;