diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-02-05 12:01:45 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-02-05 12:01:45 -0600 |
commit | 37088e19f0f390caa2a727b0c4c33d719698fe57 (patch) | |
tree | 539ec47dce6031b6358f2468be8f3dc349fc31f0 /drivers/mbmmodem | |
parent | 098bc04347fcc6e73db1f14f339265d9b1ccb065 (diff) | |
download | ofono-37088e19f0f390caa2a727b0c4c33d719698fe57.tar.bz2 |
Fix: Use snprintf instead of sprintf in mbmmodem
Diffstat (limited to 'drivers/mbmmodem')
-rw-r--r-- | drivers/mbmmodem/gprs-context.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mbmmodem/gprs-context.c b/drivers/mbmmodem/gprs-context.c index bbe7a9ad..3e7a75bf 100644 --- a/drivers/mbmmodem/gprs-context.c +++ b/drivers/mbmmodem/gprs-context.c @@ -320,7 +320,7 @@ static void mbm_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data) ncbd = g_memdup(cbd, sizeof(struct cb_data)); - sprintf(buf, "AT*ENAP=1,%u", gcd->active_context); + snprintf(buf, sizeof(buf), "AT*ENAP=1,%u", gcd->active_context); if (g_at_chat_send(gcd->chat, buf, none_prefix, mbm_enap_up_cb, ncbd, g_free) > 0) @@ -350,14 +350,14 @@ static void mbm_gprs_activate_primary(struct ofono_gprs_context *gc, cbd->user = gc; - sprintf(buf, "AT*EIAAUW=%d,1,\"%s\",\"%s\"", ctx->cid, - ctx->username, ctx->password); + snprintf(buf, sizeof(buf), "AT*EIAAUW=%d,1,\"%s\",\"%s\"", + ctx->cid, ctx->username, ctx->password); if (g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL) == 0) goto error; - len = sprintf(buf, "AT+CGDCONT=%u,\"IP\"", ctx->cid); + len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid); if (ctx->apn) snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"", |