mirror of
https://git.savannah.gnu.org/git/inetutils.git
synced 2026-01-12 00:19:39 +08:00
src/hostname.c (set_name): Handle case when hostname_new is NULL.
This commit is contained in:
@@ -232,7 +232,7 @@ set_name (const hostname_arguments *const args)
|
||||
else
|
||||
hostname_new = args->hostname_new;
|
||||
|
||||
size = strlen (hostname_new);
|
||||
size = hostname_new ? strlen (hostname_new) : 0;
|
||||
if (!size)
|
||||
error (EXIT_FAILURE, 0, "Empty hostname");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user