diff options
Diffstat (limited to 'src/common/address.c')
-rw-r--r-- | src/common/address.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/address.c b/src/common/address.c index d0c2d5e15c..26a59e923e 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -958,8 +958,10 @@ fmt_addr(const tor_addr_t *addr) { static char buf[TOR_ADDR_BUF_LEN]; if (!addr) return "<null>"; - tor_addr_to_str(buf, addr, sizeof(buf), 0); - return buf; + if (tor_addr_to_str(buf, addr, sizeof(buf), 0)) + return buf; + else + return "???"; } /** Like fmt_addr(), but takes <b>addr</b> as a host-order IPv4 |