aboutsummaryrefslogtreecommitdiff
path: root/src/rc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc.c')
-rw-r--r--src/rc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rc.c b/src/rc.c
index e61bdd57..243539f3 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -1038,7 +1038,9 @@ int main (int argc, char **argv)
(d->d_name[1] == '.' && d->d_name[2] == '\0')))
continue;
- asprintf (&tmp, RC_SVCDIR "/failed/%s", d->d_name);
+ i = strlen (RC_SVCDIR "/failed/") + strlen (d->d_name) + 1;
+ tmp = xmalloc (sizeof (char) * i);
+ snprintf (tmp, i, RC_SVCDIR "/failed/%s", d->d_name);
if (tmp) {
if (unlink (tmp))
eerror ("%s: unlink `%s': %s", applet, tmp,
@@ -1067,7 +1069,9 @@ int main (int argc, char **argv)
rc_service_plugable (d->d_name))
rc_service_mark (d->d_name, RC_SERVICE_COLDPLUGGED);
- asprintf (&tmp, DEVBOOT "/%s", d->d_name);
+ i = strlen (DEVBOOT "/") + strlen (d->d_name) + 1;
+ tmp = xmalloc (sizeof (char) * i);
+ snprintf (tmp, i, DEVBOOT "/%s", d->d_name);
if (tmp) {
if (unlink (tmp))
eerror ("%s: unlink `%s': %s", applet, tmp,