openrc-init: ignore an empty string in argv[1]

X-Gentoo-Bug: 803536
X-Gentoo-Bug-URL: https://bugs.gentoo.org/803536
Closes: https://github.com/OpenRC/openrc/pull/431
This commit is contained in:
Mike Gilbert 2021-07-23 15:27:15 -04:00 committed by William Hubbs
parent 7f47539fb1
commit dec9ef200b

View File

@ -263,7 +263,7 @@ int main(int argc, char **argv)
printf("OpenRC init version %s starting\n", VERSION);
if (argc > 1)
if (argc > 1 && argv[1][0] != '\0')
default_runlevel = argv[1];
else
default_runlevel = NULL;