sms: check for the correct return value from sscanf() in sms_get_done()
Remove an unused variable so it's more obvious what the correct value is. Fixes live (vs. list) SMS reception on ToT. BUG=none TEST=Send SMS to device, see that it shows up in Chrome. Change-Id: I9c76fb15ef229fe83672e2eee8ae37d7e6ab7b9e Reviewed-on: http://gerrit.chromium.org/gerrit/3216 Reviewed-by: Nathan J. Williams <njw chromium org> Tested-by: Nathan J. Williams <njw chromium org>
This commit is contained in:
committed by
Dan Williams
parent
531fa05192
commit
acc0928315
@@ -4323,7 +4323,7 @@ sms_get_done (MMAtSerialPort *port,
|
||||
{
|
||||
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
||||
GHashTable *properties;
|
||||
int rv, status, tpdu_len, offset;
|
||||
int rv, status, tpdu_len;
|
||||
char pdu[SMS_MAX_PDU_LEN + 1];
|
||||
|
||||
/* If the modem has already been removed, return without
|
||||
@@ -4337,9 +4337,9 @@ sms_get_done (MMAtSerialPort *port,
|
||||
}
|
||||
|
||||
/* 344 == SMS_MAX_PDU_LEN */
|
||||
rv = sscanf (response->str, "+CMGR: %d,,%d %344s %n",
|
||||
&status, &tpdu_len, pdu, &offset);
|
||||
if (rv != 4) {
|
||||
rv = sscanf (response->str, "+CMGR: %d,,%d %344s",
|
||||
&status, &tpdu_len, pdu);
|
||||
if (rv != 3) {
|
||||
info->error = g_error_new (MM_MODEM_ERROR,
|
||||
MM_MODEM_ERROR_GENERAL,
|
||||
"Failed to parse CMGR response (parsed %d items)",
|
||||
|
||||
Reference in New Issue
Block a user