Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/lldp/lldpd.c: In function : lib/lldp/lldpd.c:520:17: warning: output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncat(buffer, cfg->g_protocols[i].name, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ strlen(cfg->g_protocols[i].name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/lldp/lldpd.c: In function : lib/lldp/lldpd.c:519:17: warning: specified bound 2 equals source length [-Wstringop-overflow=] strncat(buffer, ", ", 2); ^~~~~~~~~~~~~~~~~~~~~~~~ Closer inspection shows that buffer is only used to output protocol names when debug logging is enabled, so restructure the code a bit as well. Signed-off-by: Aaron Conole <aconole@redhat.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
- Loading branch information