supervise-daemon: Fix off by ones when checking for RC_* envvars

Fixes strncmp size argument off by one as the current implementation didn't
match the `=` character.

This fixes #361.
This commit is contained in:
Disconnect3d 2020-04-13 16:26:06 +02:00 committed by William Hubbs
parent b12c52d40f
commit f5dd2f5baf

View File

@ -421,8 +421,8 @@ static void child_process(char *exec, char **argv)
TAILQ_FOREACH(env, env_list, entries) {
if ((strncmp(env->value, "RC_", 3) == 0 &&
strncmp(env->value, "RC_SERVICE=", 10) != 0 &&
strncmp(env->value, "RC_SVCNAME=", 10) != 0) ||
strncmp(env->value, "RC_SERVICE=", 11) != 0 &&
strncmp(env->value, "RC_SVCNAME=", 11) != 0) ||
strncmp(env->value, "SSD_NICELEVEL=", 14) == 0)
{
p = strchr(env->value, '=');