Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit cccb88b

Browse files
committed
Avoid use of NULL ptr
ptr must be used only if Marker == SET_MARKER Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 80ad3d0 commit cccb88b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/i_nucleo_lrwan1_wm_sg_sm_xx.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ static uint8_t at_cmd_format(ATCmd_t Cmd, void *ptr, Marker_t Marker)
256256
case AT_APPKEY: /* Supported - USI equivalent AK */
257257
case AT_NWKSKEY: /* Supported - USI equivalent NSK */
258258
case AT_APPSKEY: /* Supported - USI equivalent ASK */
259-
/* Format = FORMAT_16_02X_PARAM; */
260-
PtrValue = (uint8_t*) ptr;
261259
if(Marker == SET_MARKER) {
260+
/* Format = FORMAT_16_02X_PARAM; */
261+
PtrValue = (uint8_t*) ptr;
262262
len = AT_VPRINTF(
263263
"%s%s%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s",
264264
AT_HEADER, CmdTab[Cmd], AT_SET_MARKER,
@@ -277,9 +277,9 @@ static uint8_t at_cmd_format(ATCmd_t Cmd, void *ptr, Marker_t Marker)
277277
break;
278278
case AT_DADDR: /* Supported */
279279
case AT_NWKID: /* N/A */
280-
/*Format = FORMAT_32_02X_PARAM;*/
281-
value = *(uint32_t*)ptr;
282280
if(Marker == SET_MARKER) {
281+
/*Format = FORMAT_32_02X_PARAM;*/
282+
value = *(uint32_t*)ptr;
283283
len = AT_VPRINTF("%s%s%s%02x%s%02x%s%02x%s%02x%s", AT_HEADER,
284284
CmdTab[Cmd], AT_SET_MARKER,
285285
(unsigned)((unsigned char *)(&value))[3], AT_SEPARATOR,
@@ -293,10 +293,10 @@ static uint8_t at_cmd_format(ATCmd_t Cmd, void *ptr, Marker_t Marker)
293293
break;
294294
case AT_APPEUI: /* Supported*/
295295
case AT_DEUI: /* USI equivalent EUI - not relevant for SET since burned unique IEEE EUI64 at factory. */
296-
/* Format = FORMAT_8_02X_PARAM;*/
297-
PtrValue = (uint8_t*)ptr;
298296
if(Marker == SET_MARKER) {
299-
len = AT_VPRINTF(
297+
/* Format = FORMAT_8_02X_PARAM;*/
298+
PtrValue = (uint8_t*)ptr;
299+
len = AT_VPRINTF(
300300
"%s%s%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s%02x%s",
301301
AT_HEADER,CmdTab[Cmd],AT_SET_MARKER,
302302
PtrValue[0], AT_SEPARATOR, PtrValue[1], AT_SEPARATOR,

0 commit comments

Comments
 (0)