openssl: fix gcc8 warning

- Use memcpy instead of strncpy to copy a string without termination,
  since gcc8 warns about using strncpy to copy as many bytes from a
  string as its length.

Suggested-by: Viktor Szakats

Closes https://github.com/curl/curl/issues/2980
This commit is contained in:
Jay Satiro 2018-09-12 03:14:20 -04:00
parent 11e8a43f85
commit 357161accd
1 changed files with 1 additions and 1 deletions

View File

@ -253,7 +253,7 @@ static void ossl_keylog_callback(const SSL *ssl, const char *line)
if(!buf)
return;
}
strncpy(buf, line, linelen);
memcpy(buf, line, linelen);
buf[linelen] = '\n';
buf[linelen + 1] = '\0';