eclipse / upm

UPM is a high level repository that provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform through calls to MRAA APIs.
MIT License
659 stars 411 forks source link

Replace strncpy with memcpy #645

Closed kraj closed 5 years ago

kraj commented 6 years ago

gcc8 detects that strncpy is overwiritng the null terminating character the source strings are already initialized to 0 so memcpy would do the same job

Fixes rn2903.c:153:5: error: 'strncpy' output may be truncated copying 16 bytes from a string of length 511 [-Werror=stringop-truncation] strncpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64); ^~~~~~~~~~~~~~~~

Signed-off-by: Khem Raj raj.khem@gmail.com

Propanu commented 5 years ago

Merged with 8a617aa9044cbe5731b32d79437bd6a9ffcf2602, thanks!