diff options
Diffstat (limited to 'src/tcp_address.cpp')
-rw-r--r-- | src/tcp_address.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tcp_address.cpp b/src/tcp_address.cpp index a82298d..ae69708 100644 --- a/src/tcp_address.cpp +++ b/src/tcp_address.cpp @@ -396,7 +396,7 @@ int xs::tcp_address_t::resolve (const char *name_, bool local_, bool ipv4only_, addr_str = name_; // Remove square brackets around the address, if any. - if (!addr_str.empty () && addr_str [0] == '[' && + if (addr_str.size () >= 2 && addr_str [0] == '[' && addr_str [addr_str.size () - 1] == ']') addr_str = addr_str.substr (1, addr_str.size () - 2); |