Fix benign compiler warning in logging macro

The strncpy intentionally is not copying the NULL terminator for the log
message prefix. The NULL will be added by vsnprintf, after.
Switching to memcpy eliminates the warning.
pull/907/head
Micah Snyder 2 years ago committed by Micah Snyder
parent 93febd843b
commit 7d66717f44
  1. 2
      libclamav/others_common.c

@ -142,7 +142,7 @@ void cl_set_clcb_msg(clcb_msg callback)
va_list args; \
size_t len = sizeof(x) - 1; \
char buff[MSGBUFSIZ]; \
strncpy(buff, x, len); \
memcpy(buff, x, len); \
va_start(args, str); \
vsnprintf(buff + len, sizeof(buff) - len, str, args); \
va_end(args)

Loading…
Cancel
Save