src/hostname.c (set_name): Handle case when hostname_new is NULL.

This commit is contained in:
Alfred M. Szmidt
2017-07-10 20:08:00 +00:00
parent 7f221ff1f9
commit 5508475631
2 changed files with 6 additions and 1 deletions

View File

@@ -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");