mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:03:34 +03:00
tests: replace strcpy() with curlx_strcopy()
Also: - examples/hsts-preload: apply the same change as it's based on lib1915 in tests. Make a local clone of `curlx_strcopy()`. Then drop the `_CRT_SECURE_NO_WARNINGS` hack, that's no longer necessary. - curl_setup.h: delete `strcpy()` from the `_CRT_SECURE_NO_WARNINGS` list. Closes #20076
This commit is contained in:
parent
66aec526fc
commit
436e67f65b
9 changed files with 43 additions and 30 deletions
|
|
@ -560,10 +560,14 @@ static CURLcode test_unit3205(const char *arg)
|
|||
|
||||
/* suites matched by EDH alias will return the DHE name */
|
||||
if(test->id >= 0x0011 && test->id < 0x0017) {
|
||||
if(expect && memcmp(expect, "EDH-", 4) == 0)
|
||||
expect = (char *)memcpy(strcpy(alt, expect), "DHE-", 4);
|
||||
if(expect && memcmp(expect + 4, "EDH-", 4) == 0)
|
||||
expect = (char *)memcpy(strcpy(alt, expect) + 4, "DHE-", 4) - 4;
|
||||
if(expect && memcmp(expect, "EDH-", 4) == 0) {
|
||||
curlx_strcopy(alt, sizeof(alt), expect, strlen(expect));
|
||||
expect = (char *)memcpy(alt, "DHE-", 4);
|
||||
}
|
||||
if(expect && memcmp(expect + 4, "EDH-", 4) == 0) {
|
||||
curlx_strcopy(alt, sizeof(alt), expect, strlen(expect));
|
||||
expect = (char *)memcpy(alt + 4, "DHE-", 4) - 4;
|
||||
}
|
||||
}
|
||||
|
||||
if(expect && strcmp(buf, expect) != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue