mirror of
https://github.com/curl/curl.git
synced 2026-06-02 00:04:15 +03: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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue