aboutsummaryrefslogtreecommitdiff
path: root/src/runscript.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runscript.c')
-rw-r--r--src/runscript.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/runscript.c b/src/runscript.c
index dd0acb37..b17aede7 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -1080,22 +1080,23 @@ int main (int argc, char **argv)
/* eprefix is kinda klunky, but it works for our purposes */
if (rc_is_env ("RC_PREFIX", "yes")) {
int l = 0;
+ int ll;
char *svc;
/* Get the longest service name */
services = rc_services_in_runlevel (NULL);
STRLIST_FOREACH (services, svc, i) {
- int ll = strlen (svc);
+ ll = strlen (svc);
if (ll > l)
l = ll;
}
- // rc_strlist_free (services);
-
- svc = prefix = rc_xmalloc (sizeof (char *) * l);
- svc += strlcpy (prefix, applet, l);
- i = l - strlen (prefix);
- memset (svc, ' ', i);
- memset (svc + i, 0, 1);
+
+ /* Make our prefix string */
+ prefix = rc_xmalloc (sizeof (char *) * l);
+ ll = strlen (applet);
+ memcpy (prefix, applet, ll);
+ memset (prefix + ll, ' ', l - ll);
+ memset (prefix + l, 0, 1);
eprefix (prefix);
}