diff --git a/drivers/hsomodem/gprs-context.c b/drivers/hsomodem/gprs-context.c index 340092fa..ca622480 100644 --- a/drivers/hsomodem/gprs-context.c +++ b/drivers/hsomodem/gprs-context.c @@ -150,7 +150,6 @@ static void hso_gprs_activate_primary(struct ofono_gprs_context *gc, struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc); struct cb_data *cbd = cb_data_new(cb, data); char buf[AUTH_BUF_LENGTH]; - int len; /* IPv6 support not implemented */ if (ctx->proto != OFONO_GPRS_PROTO_IP) @@ -173,11 +172,8 @@ static void hso_gprs_activate_primary(struct ofono_gprs_context *gc, NULL, NULL, NULL) == 0) goto error; - len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid); - - if (ctx->apn) - snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"", - ctx->apn); + snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\",\"%s\"", + ctx->cid, ctx->apn); if (g_at_chat_send(gcd->chat, buf, none_prefix, hso_cgdcont_cb, cbd, g_free) > 0)