summaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 9aab637..c6aa45c 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1203,11 +1203,7 @@ static void parse_and_put_prompt(const char *prmt_ptr)
break;
#endif
case 'h':
- pbuf = free_me = xzalloc(256);
- if (gethostname(pbuf, 255) < 0) {
- pbuf[0] = '?';
- pbuf[1] = '\0';
- }
+ pbuf = free_me = safe_gethostname();
*strchrnul(pbuf, '.') = '\0';
break;
case '$':