inet: fix inconsistent return value of inet_ntop6
PR-URL: https://github.com/libuv/libuv/pull/3182 Reviewed-By: Jameson Nash <vtjnash@gmail.com>
This commit is contained in:
parent
4cf638de05
commit
385b7960a0
@ -141,8 +141,9 @@ static int inet_ntop6(const unsigned char *src, char *dst, size_t size) {
|
||||
if (best.base != -1 && (best.base + best.len) == ARRAY_SIZE(words))
|
||||
*tp++ = ':';
|
||||
*tp++ = '\0';
|
||||
if (UV_E2BIG == uv__strscpy(dst, tmp, size))
|
||||
if ((size_t) (tp - tmp) > size)
|
||||
return UV_ENOSPC;
|
||||
uv__strscpy(dst, tmp, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user