aboutsummaryrefslogtreecommitdiff
path: root/src/librc-misc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-09-25 15:38:21 +0000
committerRoy Marples <roy@marples.name>2007-09-25 15:38:21 +0000
commit1e4e8ed27ae95096255283e92a75738bc7e296e5 (patch)
tree5f152e91cce64bc2c9b0c6336b4078e470ac14da /src/librc-misc.c
parenta2e5c4513e2955bc0a77c401ea12cc210eab305b (diff)
Initial doxygen documentation for rc.h and einfo.h. Plus some header clean ups.
Diffstat (limited to 'src/librc-misc.c')
-rw-r--r--src/librc-misc.c9
1 files changed, 5 insertions, 4 deletions
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)