summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--metaconfig.h2
-rw-r--r--pp_sys.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/metaconfig.h b/metaconfig.h
index 96a02a57eb..baba5eac68 100644
--- a/metaconfig.h
+++ b/metaconfig.h
@@ -13,5 +13,5 @@
* Symbols should only be here temporarily. Once they are actually used,
* they should be removed from here.
*
- * HAS_WCRTOMB HAS_SOCKADDR_STORAGE
+ * HAS_WCRTOMB
*/
diff --git a/pp_sys.c b/pp_sys.c
index 9bae03dc08..8c26d23571 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2763,9 +2763,13 @@ PP(pp_getpeername)
if (!IoIFP(io))
goto nuts;
- sv = sv_2mortal(newSV(257));
- (void)SvPOK_only(sv);
+#ifdef HAS_SOCKADDR_STORAGE
+ len = sizeof(struct sockaddr_storage);
+#else
len = 256;
+#endif
+ sv = sv_2mortal(newSV(len+1));
+ (void)SvPOK_only(sv);
SvCUR_set(sv, len);
*SvEND(sv) ='\0';
fd = PerlIO_fileno(IoIFP(io));