From 1e4e8ed27ae95096255283e92a75738bc7e296e5 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 25 Sep 2007 15:38:21 +0000 Subject: Initial doxygen documentation for rc.h and einfo.h. Plus some header clean ups. --- src/librc-misc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/librc-misc.c') diff --git a/src/librc-misc.c b/src/librc-misc.c index ebf020e2..bd92e584 100644 --- a/src/librc-misc.c +++ b/src/librc-misc.c @@ -588,9 +588,10 @@ char **rc_make_env (void) bool has_net_fs_list = false; FILE *fp; char buffer[PATH_MAX]; + char *runlevel = rc_get_runlevel (); /* Don't trust environ for softlevel yet */ - snprintf (buffer, PATH_MAX, "%s.%s", RC_CONFIG, rc_get_runlevel()); + snprintf (buffer, PATH_MAX, "%s.%s", RC_CONFIG, runlevel); if (rc_exists (buffer)) config = rc_get_config (buffer); else @@ -632,10 +633,9 @@ char **rc_make_env (void) rc_strlist_add (&env, "RC_BOOTLEVEL=" RC_LEVEL_BOOT); - p = rc_get_runlevel (); - i = strlen ("RC_SOFTLEVEL=") + strlen (p) + 1; + i = strlen ("RC_SOFTLEVEL=") + strlen (runlevel) + 1; line = rc_xmalloc (sizeof (char *) * i); - snprintf (line, i, "RC_SOFTLEVEL=%s", p); + snprintf (line, i, "RC_SOFTLEVEL=%s", runlevel); rc_strlist_add (&env, line); free (line); @@ -717,6 +717,7 @@ char **rc_make_env (void) free (line); } + free (runlevel); return (env); } librc_hidden_def(rc_make_env) -- cgit v1.2.3