drivers: modem: sara-r4: Replace snprintf calls by snprintk

Snprintf calls should be avoid when not necessary, instead snprintk
should be used as it offers the same functionnalities at a lower cost
in flash.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
This commit is contained in:
Xavier Chapron 2021-09-14 17:04:13 +02:00 committed by Anas Nashif
commit f83bb02cbf

View file

@ -1238,7 +1238,7 @@ restart:
/* autodetect APN from IMSI */
char cmd[sizeof("AT+CGDCONT=1,\"IP\",\"\"")+MDM_APN_LENGTH];
snprintf(cmd, sizeof(cmd), "AT+CGDCONT=1,\"IP\",\"%s\"", mdata.mdm_apn);
snprintk(cmd, sizeof(cmd), "AT+CGDCONT=1,\"IP\",\"%s\"", mdata.mdm_apn);
/* setup PDP context definition */
ret = modem_cmd_send(&mctx.iface, &mctx.cmd_handler,
@ -1337,7 +1337,7 @@ restart:
/* setup PDP context definition */
char cmd[sizeof("AT+UPSD=0,1,\"%s\"")+MDM_APN_LENGTH];
snprintf(cmd, sizeof(cmd), "AT+UPSD=0,1,\"%s\"", mdata.mdm_apn);
snprintk(cmd, sizeof(cmd), "AT+UPSD=0,1,\"%s\"", mdata.mdm_apn);
ret = modem_cmd_send(&mctx.iface, &mctx.cmd_handler,
NULL, 0,
(const char *)cmd,