summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-09-08 11:27:49 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-09-09 07:53:42 +0200
commit2f0bb864c126892afc822e0cf5547d7ea5094212 (patch)
treea22cb9fb03b3b731923cc1ffe4245b0a606297fe /lib/url.c
parent71f9a8fa6f52723c0492c61ded070386706e99c6 (diff)
downloadcurl-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index 8a2845ddd..b672710c5 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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;
}