diff options
author | kevlo <kevlo@FreeBSD.org> | 2014-02-07 15:26:19 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2014-02-07 15:26:19 +0000 |
commit | 4a0c9deef4d526eb5b11aac95f782a67a2b94465 (patch) | |
tree | a5ab2944bac3ace2fbc866862d6e9fe58c2e3dd2 /lib | |
parent | 9d7706f9f4506fb689de9cbadb4452174b30d194 (diff) | |
download | FreeBSD-src-4a0c9deef4d526eb5b11aac95f782a67a2b94465.zip FreeBSD-src-4a0c9deef4d526eb5b11aac95f782a67a2b94465.tar.gz |
Set errno on inet_ntop(3) failure.
Reviewed by: glebius
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/inet/inet_ntop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/inet/inet_ntop.c b/lib/libc/inet/inet_ntop.c index 6d21027..d57e6ab 100644 --- a/lib/libc/inet/inet_ntop.c +++ b/lib/libc/inet/inet_ntop.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); static const char *inet_ntop4(const u_char *src, char *dst, socklen_t size); static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size); -/* char * +/* const char * * inet_ntop(af, src, dst, size) * convert a network format address to presentation format. * return: @@ -169,8 +169,10 @@ inet_ntop6(const u_char *src, char *dst, socklen_t size) if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 7 && words[7] != 0x0001) || (best.len == 5 && words[5] == 0xffff))) { - if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) { + errno = ENOSPC; return (NULL); + } tp += strlen(tp); break; } |