summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index d7a6574a1c..d80449ed3e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3252,7 +3252,8 @@ PP(pp_ghostent)
PUSHs(sv = sv_newmortal());
if (hent) {
if (which == OP_GHBYNAME) {
- sv_setpvn(sv, hent->h_addr, hent->h_length);
+ if (hent->h_addr)
+ sv_setpvn(sv, hent->h_addr, hent->h_length);
}
else
sv_setpv(sv, (char*)hent->h_name);
@@ -3281,7 +3282,8 @@ PP(pp_ghostent)
}
#else
PUSHs(sv = sv_mortalcopy(&sv_no));
- sv_setpvn(sv, hent->h_addr, len);
+ if (hent->h_addr)
+ sv_setpvn(sv, hent->h_addr, len);
#endif /* h_addr */
}
RETURN;