diff options
author | Nathan J. Williams <njw@chromium.org> | 2011-08-21 08:59:11 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-08-21 08:59:11 -0500 |
commit | acc0928315f166708405f6c671a6fd58170a2c3c (patch) | |
tree | 1af57bde3d35f064a714c370882d471eebc6d1dc | |
parent | 531fa05192d038d86207268d34d9837e7c0fbbcf (diff) |
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>
-rw-r--r-- | src/mm-generic-gsm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c index be985b11..339f7fd1 100644 --- a/src/mm-generic-gsm.c +++ b/src/mm-generic-gsm.c @@ -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)", |