From 5d77c0db6b8641b39a27b0824fc3a7e075d38ff5 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 17 Mar 2008 14:42:10 +0000 Subject: [PATCH] This should be a fixed buffer. --- src/librc/librc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/librc/librc.c b/src/librc/librc.c index d3a4685b..df6ab9c0 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -478,7 +478,7 @@ bool rc_service_mark(const char *service, const RC_SERVICE state) char *init = rc_service_resolve(service); bool skip_wasinactive = false; int s; - char *was; + char was[PATH_MAX]; RC_STRINGLIST *dirs; RC_STRING *dir; int serrno; @@ -495,7 +495,7 @@ bool rc_service_mark(const char *service, const RC_SERVICE state) } snprintf(file, sizeof(file), RC_SVCDIR "/%s/%s", - rc_parse_service_state (state), base); + rc_parse_service_state(state), base); if (exists(file)) unlink(file); i = symlink(init, file); @@ -503,10 +503,9 @@ bool rc_service_mark(const char *service, const RC_SERVICE state) free(init); return false; } - skip_state = state; } - + if (state == RC_SERVICE_COLDPLUGGED || state == RC_SERVICE_FAILED) { free(init); return true; @@ -523,7 +522,7 @@ bool rc_service_mark(const char *service, const RC_SERVICE state) (! skip_wasinactive || s != RC_SERVICE_WASINACTIVE)) { snprintf(file, sizeof(file), RC_SVCDIR "/%s/%s", - rc_parse_service_state(s), base); + rc_service_state_names[i].name, base); if (exists(file)) { if ((state == RC_SERVICE_STARTING || state == RC_SERVICE_STOPPING) &&