diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-09-08 11:27:49 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-09-09 07:53:42 +0200 |
commit | 2f0bb864c126892afc822e0cf5547d7ea5094212 (patch) | |
tree | a22cb9fb03b3b731923cc1ffe4245b0a606297fe /lib/url.c | |
parent | 71f9a8fa6f52723c0492c61ded070386706e99c6 (diff) | |
download | curl-2f0bb864c126892afc822e0cf5547d7ea5094212.tar.gz |
lib: don't use strerror()
We have and provide Curl_strerror() internally for a reason: strerror()
is not necessarily thread-safe so we should always try to avoid it.
Extended checksrc to warn for this, but feature the check disabled by
default and only enable it in lib/
Closes #7685
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1892,9 +1892,11 @@ static void zonefrom_url(CURLU *uh, struct Curl_easy *data, #else scopeidx = if_nametoindex(zoneid); #endif - if(!scopeidx) + if(!scopeidx) { + char buffer[STRERROR_LEN]; infof(data, "Invalid zoneid: %s; %s", zoneid, - strerror(errno)); + Curl_strerror(errno, buffer, sizeof(buffer))); + } else conn->scope_id = scopeidx; } |