Don't segv when trying to add a 0-length unit name. Some string-related cleanups inspired by OpenBSD.
Don't segv when trying to add a 0-length unit name.
Some string-related cleanups inspired by OpenBSD.

Reviewed by:	asmodai

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase