diff options
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 9aab63702..c6aa45c93 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -1203,11 +1203,7 @@ static void parse_and_put_prompt(const char *prmt_ptr) | |||
1203 | break; | 1203 | break; |
1204 | #endif | 1204 | #endif |
1205 | case 'h': | 1205 | case 'h': |
1206 | pbuf = free_me = xzalloc(256); | 1206 | pbuf = free_me = safe_gethostname(); |
1207 | if (gethostname(pbuf, 255) < 0) { | ||
1208 | pbuf[0] = '?'; | ||
1209 | pbuf[1] = '\0'; | ||
1210 | } | ||
1211 | *strchrnul(pbuf, '.') = '\0'; | 1207 | *strchrnul(pbuf, '.') = '\0'; |
1212 | break; | 1208 | break; |
1213 | case '$': | 1209 | case '$': |