diff options
author | Roy Marples <roy@marples.name> | 2008-03-19 12:26:47 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-19 12:26:47 +0000 |
commit | 1443fee901afd4f5fc9ea5b57f0f41369ce93532 (patch) | |
tree | 686a3f58bb5efee6a83464df6cb24784c4629f86 /src | |
parent | cdd3881c1b301f3cd1035ca1eedf2bfcc37e4403 (diff) |
Fix errors when reporting who we are scheduled by.
Diffstat (limited to 'src')
-rw-r--r-- | src/rc/runscript.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rc/runscript.c b/src/rc/runscript.c index 2cab4dc8..a889e6a1 100644 --- a/src/rc/runscript.c +++ b/src/rc/runscript.c @@ -791,10 +791,12 @@ static void svc_start(bool deps) rc_service_schedule_start(svc->value, service); use_services = rc_deptree_depend(deptree, "iprovide", svc->value); - TAILQ_FOREACH (svc2, use_services, entries) - rc_service_schedule_start(svc2->value, service); - rc_stringlist_free(use_services); - use_services = NULL; + if (use_services) { + TAILQ_FOREACH (svc2, use_services, entries) + rc_service_schedule_start(svc2->value, service); + rc_stringlist_free(use_services); + use_services = NULL; + } len += strlen(svc->value) + 2; n++; } @@ -804,13 +806,13 @@ static void svc_start(bool deps) TAILQ_FOREACH(svc, tmplist, entries) { if (p != tmp) p += snprintf(p, len, ", "); - p += snprintf(p, len, "%s", svc->value); + p += snprintf(p, len - (p - tmp), "%s", svc->value); } - free(tmp); rc_stringlist_free(tmplist); tmplist = NULL; ewarnx("WARNING: %s is scheduled to start when %s has started", applet, tmp); + free(tmp); } rc_stringlist_free(services); |