Skip to content

Commit 109ae33

Browse files
committed
applications: nrf_desktop: config_event: address string truncation error
Replaced the implementation of the copy operation in the GEN_CONFIG_EVENT_HANDLERS macro declaration of the Config Event header that is part of the nRF Desktop application. This change is done to address the string truncation error (-Werror=stringop-truncation) that was caused by the strncpy function. Signed-off-by: Kamil Piszczek <[email protected]>
1 parent 543ed35 commit 109ae33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

applications/nrf_desktop/src/events/config_event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ extern const uint8_t __start_config_channel_modules[];
141141
rsp_data_size = strlen(data_ptr); \
142142
__ASSERT_NO_MSG(rsp_data_size <= \
143143
sizeof(rsp_data_buf)); \
144-
strncpy((char *) rsp_data_buf, data_ptr, \
144+
memcpy(rsp_data_buf, data_ptr, \
145145
rsp_data_size); \
146146
cur_opt_descr++; \
147147
} else { \

0 commit comments

Comments
 (0)