From 143239e143d57c550e949fb3fcc4540de7c8d354 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 6 Apr 2008 13:24:10 +0000 Subject: Increase pidstr size to 10 chars. --- src/rc/rc.c | 2 +- src/rc/runscript.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/rc') diff --git a/src/rc/rc.c b/src/rc/rc.c index 43bcb48e..b305b2d1 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -954,7 +954,7 @@ int main(int argc, char **argv) bool going_down = false; int depoptions = RC_DEP_STRICT | RC_DEP_TRACE; char krunlevel [PATH_MAX]; - char pidstr[6]; + char pidstr[10]; int opt; bool parallel; int regen = 0; diff --git a/src/rc/runscript.c b/src/rc/runscript.c index aa4a6021..c2cef71c 100644 --- a/src/rc/runscript.c +++ b/src/rc/runscript.c @@ -1084,7 +1084,7 @@ int runscript(int argc, char **argv) { bool deps = true; bool doneone = false; - char pid[16]; + char pidstr[10]; int retval; int opt; RC_STRING *svc; @@ -1143,8 +1143,8 @@ int runscript(int argc, char **argv) /* Set an env var so that we always know our pid regardless of any subshells the init script may create so that our mark_service_* functions can always instruct us of this change */ - snprintf(pid, sizeof(pid), "%d", (int) getpid()); - setenv("RC_RUNSCRIPT_PID", pid, 1); + snprintf(pidstr, sizeof(pidstr), "%d", (int) getpid()); + setenv("RC_RUNSCRIPT_PID", pidstr, 1); /* eprefix is kinda klunky, but it works for our purposes */ if (rc_conf_yesno("rc_parallel")) { -- cgit v1.2.3