From acc0928315f166708405f6c671a6fd58170a2c3c Mon Sep 17 00:00:00 2001 From: "Nathan J. Williams" Date: Sun, 21 Aug 2011 08:59:11 -0500 Subject: [PATCH] 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 Tested-by: Nathan J. Williams --- src/mm-generic-gsm.c | 8 ++++---- 1 file 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)",