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

The same as https://github.com/OpenRC/openrc/pull/361

This fixes #362.
This commit is contained in:
Disconnect3d 2020-04-13 16:27:06 +02:00 committed by William Hubbs
parent f5dd2f5baf
commit 0ddab761be

View File

@ -864,8 +864,8 @@ int main(int argc, char **argv)
TAILQ_FOREACH(env, env_list, entries) { TAILQ_FOREACH(env, env_list, entries) {
if ((strncmp(env->value, "RC_", 3) == 0 && if ((strncmp(env->value, "RC_", 3) == 0 &&
strncmp(env->value, "RC_SERVICE=", 10) != 0 && strncmp(env->value, "RC_SERVICE=", 11) != 0 &&
strncmp(env->value, "RC_SVCNAME=", 10) != 0) || strncmp(env->value, "RC_SVCNAME=", 11) != 0) ||
strncmp(env->value, "SSD_NICELEVEL=", 14) == 0 || strncmp(env->value, "SSD_NICELEVEL=", 14) == 0 ||
strncmp(env->value, "SSD_IONICELEVEL=", 16) == 0) strncmp(env->value, "SSD_IONICELEVEL=", 16) == 0)
{ {