Skip to content

Commit

Permalink
Fix mid char array size
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankZRS committed Feb 2, 2024
1 parent dc06df3 commit a9c5585
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion knx_iot_virtual_pb.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ app_init(void)
/* set the firmware version 0.7.0 */
oc_core_set_device_fwv(0, 0, 7, 0);

char mid[20];
char mid[5];
strncpy(mid, g_serial_number, 5); // mid = first 4 digits of sn
mid[4] = '\0';
long int mid_num = strtol(mid, NULL, 16);
Expand Down
2 changes: 1 addition & 1 deletion knx_iot_virtual_sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ app_init(void)
/* set the firmware version 0.7.0 */
oc_core_set_device_fwv(0, 0, 7, 0);

char mid[20];
char mid[5];
strncpy(mid, g_serial_number, 5); // mid = first 4 digits of sn
mid[4] = '\0';
long int mid_num = strtol(mid, NULL, 16);
Expand Down

0 comments on commit a9c5585

Please sign in to comment.