From ec5130c3f966e76fe11df22fe8a04c8fe862187d Mon Sep 17 00:00:00 2001 From: twosee Date: Tue, 8 Nov 2022 16:56:14 +0800 Subject: [PATCH] unix,win: fix 'sprintf' is deprecated warning (#3813) --- src/inet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inet.c b/src/inet.c index 4b630f53..cd774968 100644 --- a/src/inet.c +++ b/src/inet.c @@ -130,7 +130,7 @@ static int inet_ntop6(const unsigned char *src, char *dst, size_t size) { tp += strlen(tp); break; } - tp += sprintf(tp, "%x", words[i]); + tp += snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == ARRAY_SIZE(words))