don't allow zero length unit names
This commit is contained in:
parent
b78d0be16d
commit
48e11fe880
3
unit.c
3
unit.c
|
@ -62,6 +62,9 @@ bool unit_name_is_valid(const char *n) {
|
||||||
if (!(e = strrchr(n, '.')))
|
if (!(e = strrchr(n, '.')))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (e == n)
|
||||||
|
return false;
|
||||||
|
|
||||||
for (i = n; i < e; i++)
|
for (i = n; i < e; i++)
|
||||||
if (!strchr(VALID_CHARS, *i))
|
if (!strchr(VALID_CHARS, *i))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue