mirror of
https://github.com/moparisthebest/curl
synced 2024-12-23 16:48:49 -05:00
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:
parent
11e8a43f85
commit
357161accd
@ -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';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user