summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAki Niemi <aki.niemi@nokia.com>2011-03-03 18:35:28 +0200
committerAki Niemi <aki.niemi@nokia.com>2011-03-03 18:35:28 +0200
commitabe5e874830eff2e9bd5f3405951666b7e8d1385 (patch)
tree1a0fead574558559be6b0197efcb958f213a9d98
parenta82f09863659d66d9a0fb96e88f6ae3a91f7387b (diff)
downloadofono-abe5e874830eff2e9bd5f3405951666b7e8d1385.tar.bz2
isimodem: Fix call-forwarding driver
Message length was incorrectly calculated. Also some cleanups.
-rw-r--r--drivers/isimodem/call-forwarding.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/isimodem/call-forwarding.c b/drivers/isimodem/call-forwarding.c
index 7da275d4..52c28fec 100644
--- a/drivers/isimodem/call-forwarding.c
+++ b/drivers/isimodem/call-forwarding.c
@@ -226,22 +226,22 @@ static void isi_registration(struct ofono_call_forwarding *cf, int type,
* zero sub address bytes, and 0 to 3 bytes of filler
*/
};
- size_t msg_len = 7 + 6 + numlen * 2 * pad_len;
+ size_t msg_len = 7 + 6 + numlen * 2 + pad_len;
- if (cbd == NULL || fd == NULL || strlen(number->number) > 28)
+ if (cbd == NULL || fd == NULL || numlen > 28)
goto error;
- DBG("forwarding type %d class %d\n", type, cls);
+ DBG("forwarding type %d class %d number %s", type, cls, number->number);
if (ss_code < 0)
goto error;
- ucs2 = g_convert(number->number, strlen(number->number), "UCS-2BE",
- "UTF-8//TRANSLIT", NULL, NULL, NULL);
+ ucs2 = g_convert(number->number, numlen, "UCS-2BE", "UTF-8//TRANSLIT",
+ NULL, NULL, NULL);
if (ucs2 == NULL)
goto error;
- memcpy((char *) &msg[13], ucs2, strlen(number->number) * 2);
+ memcpy(msg + 13, ucs2, numlen * 2);
g_free(ucs2);
if (g_isi_client_send(fd->client, msg, msg_len, registration_resp_cb,
@@ -296,10 +296,9 @@ static void isi_erasure(struct ofono_call_forwarding *cf, int type, int cls,
SS_SERVICE_REQ,
SS_ERASURE,
SS_GSM_TELEPHONY,
- ss_code >> 8, /* Supplementary services code */
- ss_code & 0xFF,
+ ss_code >> 8, ss_code & 0xFF,
SS_SEND_ADDITIONAL_INFO,
- 0 /* Subblock count */
+ 0, /* Subblock count */
};
DBG("forwarding type %d class %d", type, cls);