diff options
Diffstat (limited to 'src/shared/sockhelper.c')
-rw-r--r-- | src/shared/sockhelper.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shared/sockhelper.c b/src/shared/sockhelper.c index 1970447..5096320 100644 --- a/src/shared/sockhelper.c +++ b/src/shared/sockhelper.c @@ -241,7 +241,10 @@ size_t sock_printable(const struct sockaddr * const addr, const socklen_t addrLe outlen = snprintf( output, len, "[%s]:%s", host, port ); } } - if ( outlen <= 0 ) return 0; + if ( outlen <= 0 ) { + output[0] = '\0'; + return 0; + } return MIN( (size_t)outlen, len-1 ); } |