summaryrefslogtreecommitdiff
path: root/ext/Socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Socket')
-rw-r--r--ext/Socket/Socket.xs5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index 79e1dfd22a..d844775e4f 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -263,8 +263,9 @@ inet_ntoa(ip_address_sv)
addrlen, sizeof(addr));
/* We could use inet_ntoa() but that is broken
* in HP-UX + GCC + 64bitint (returns "0.0.0.0"),
- * so let's use this sprintf() workaround everywhere. */
- New(1138, addr_str, 4 * 3 + 3 + 1, char);
+ * so let's use this sprintf() workaround everywhere.
+ * This is also more threadsafe than using inet_ntoa(). */
+ New(1138, addr_str, 4 * 3 + 3 + 1, char); /* IPv6? */
sprintf(addr_str, "%d.%d.%d.%d",
((addr.s_addr >> 24) & 0xFF),
((addr.s_addr >> 16) & 0xFF),