Closed kkajrewicz closed 6 years ago
My distro: Fedora 28 gcc 8.1.1
Logs: build_log.txt
(...) In file included from benchmark.hpp:64, from blk.cpp:37: In function ‘int util_safe_strcpy(char*, const char*, size_t)’, inlined from ‘int blk_exit(benchmark*, benchmark_args*)’ at blk.cpp:596:22: ../common/util.h:161:9: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 4096 equals destination size [-Werror=stringop-truncation] strncpy(dst, src, max_length); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ (...)
Following solution fixes the building issue:
static inline int util_safe_strcpy(char *dst, const char *src, size_t max_length) if (max_length == 0) return -1; if (strlen(src) + 1 > max_length) return -1; strncpy(dst, src, max_length); return 0; }
Found on 1.4-rc4-360-g14296ee8
Fix merged. Please verify.
Verified on 1.4-rc4-468-g856e5e14b
My distro: Fedora 28 gcc 8.1.1
Logs: build_log.txt
Following solution fixes the building issue:
Found on 1.4-rc4-360-g14296ee8