summaryrefslogtreecommitdiffstats
path: root/drivers/atmodem/call-forwarding.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atmodem/call-forwarding.c')
-rw-r--r--drivers/atmodem/call-forwarding.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/atmodem/call-forwarding.c b/drivers/atmodem/call-forwarding.c
index d2d42d12..b210242f 100644
--- a/drivers/atmodem/call-forwarding.c
+++ b/drivers/atmodem/call-forwarding.c
@@ -135,9 +135,9 @@ static void at_ccfc_query(struct ofono_call_forwarding *cf, int type, int cls,
cbd->user = GINT_TO_POINTER(cls);
if (cls == 7)
- sprintf(buf, "AT+CCFC=%d,2", type);
+ snprintf(buf, sizeof(buf), "AT+CCFC=%d,2", type);
else
- sprintf(buf, "AT+CCFC=%d,2,,,%d", type, cls);
+ snprintf(buf, sizeof(buf), "AT+CCFC=%d,2,,,%d", type, cls);
if (g_at_chat_send(chat, buf, ccfc_prefix,
ccfc_query_cb, cbd, g_free) > 0)
@@ -189,10 +189,10 @@ static void at_ccfc_erasure(struct ofono_call_forwarding *cf,
char buf[128];
int len;
- len = sprintf(buf, "AT+CCFC=%d,4", type);
+ len = snprintf(buf, sizeof(buf), "AT+CCFC=%d,4", type);
if (cls != 7)
- sprintf(buf + len, ",,,%d", cls);
+ snprintf(buf + len, sizeof(buf) - len, ",,,%d", cls);
at_ccfc_set(cf, buf, cb, data);
}
@@ -205,10 +205,10 @@ static void at_ccfc_deactivation(struct ofono_call_forwarding *cf,
char buf[128];
int len;
- len = sprintf(buf, "AT+CCFC=%d,0", type);
+ len = snprintf(buf, sizeof(buf), "AT+CCFC=%d,0", type);
if (cls != 7)
- sprintf(buf + len, ",,,%d", cls);
+ snprintf(buf + len, sizeof(buf) - len, ",,,%d", cls);
at_ccfc_set(cf, buf, cb, data);
}
@@ -220,10 +220,10 @@ static void at_ccfc_activation(struct ofono_call_forwarding *cf,
char buf[128];
int len;
- len = sprintf(buf, "AT+CCFC=%d,1", type);
+ len = snprintf(buf, sizeof(buf), "AT+CCFC=%d,1", type);
if (cls != 7)
- sprintf(buf + len, ",,,%d", cls);
+ snprintf(buf + len, sizeof(buf) - len, ",,,%d", cls);
at_ccfc_set(cf, buf, cb, data);
}
@@ -238,11 +238,11 @@ static void at_ccfc_registration(struct ofono_call_forwarding *cf,
char buf[128];
int offset;
- offset = sprintf(buf, "AT+CCFC=%d,3,\"%s\",%d,%d", type,
+ offset = snprintf(buf, sizeof(buf), "AT+CCFC=%d,3,\"%s\",%d,%d", type,
ph->number, ph->type, cls);
if (type == 2 || type == 4 || type == 5)
- sprintf(buf+offset, ",,,%d", time);
+ snprintf(buf+offset, sizeof(buf) - offset, ",,,%d", time);
at_ccfc_set(cf, buf, cb, data);
}