From 9e39a934b822adf811cab4f63712e487f1d9779a Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 19 Feb 2008 21:45:01 +0000 Subject: Fix an off-by-one error. --- src/rc/runscript.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rc/runscript.c b/src/rc/runscript.c index 3d900c0c..4405edd8 100644 --- a/src/rc/runscript.c +++ b/src/rc/runscript.c @@ -427,9 +427,9 @@ static bool svc_exec (const char *arg1, const char *arg2) openpty (&master_tty, &slave_tty, NULL, &tt, &ws); } - service_pid = vfork(); + service_pid = fork(); if (service_pid == -1) - eerrorx ("%s: vfork: %s", service, strerror (errno)); + eerrorx ("%s: fork: %s", service, strerror (errno)); if (service_pid == 0) { if (slave_tty >= 0) { close (master_tty); @@ -1144,7 +1144,7 @@ int runscript (int argc, char **argv) } /* Make our prefix string */ - prefix = xmalloc (sizeof (char) * l); + prefix = xmalloc (sizeof (char) * l + 1); ll = strlen (applet); memcpy (prefix, applet, ll); memset (prefix + ll, ' ', l - ll); -- cgit v1.2.3