Skip to content

Commit f83bb02

Browse files
Xavier Chapronnashif
authored andcommitted
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 <[email protected]>
1 parent 0774ce9 commit f83bb02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/modem/ublox-sara-r4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ static void modem_reset(void)
12381238
/* autodetect APN from IMSI */
12391239
char cmd[sizeof("AT+CGDCONT=1,\"IP\",\"\"")+MDM_APN_LENGTH];
12401240

1241-
snprintf(cmd, sizeof(cmd), "AT+CGDCONT=1,\"IP\",\"%s\"", mdata.mdm_apn);
1241+
snprintk(cmd, sizeof(cmd), "AT+CGDCONT=1,\"IP\",\"%s\"", mdata.mdm_apn);
12421242

12431243
/* setup PDP context definition */
12441244
ret = modem_cmd_send(&mctx.iface, &mctx.cmd_handler,
@@ -1337,7 +1337,7 @@ static void modem_reset(void)
13371337
/* setup PDP context definition */
13381338
char cmd[sizeof("AT+UPSD=0,1,\"%s\"")+MDM_APN_LENGTH];
13391339

1340-
snprintf(cmd, sizeof(cmd), "AT+UPSD=0,1,\"%s\"", mdata.mdm_apn);
1340+
snprintk(cmd, sizeof(cmd), "AT+UPSD=0,1,\"%s\"", mdata.mdm_apn);
13411341
ret = modem_cmd_send(&mctx.iface, &mctx.cmd_handler,
13421342
NULL, 0,
13431343
(const char *)cmd,

0 commit comments

Comments
 (0)