X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fheadtail.c;fp=daemon%2Fheadtail.c;h=af2648cc7940f8bc4b47fac388faeeffc9736036;hp=6d248513ab9f0538a4e7c6fda96429c496acdc7f;hb=78029b529ad98769685d607230b70f71832d5906;hpb=e8c954933b2bfb3bc3ead5a151d49d164f1a8eab diff --git a/daemon/headtail.c b/daemon/headtail.c index 6d24851..af2648c 100644 --- a/daemon/headtail.c +++ b/daemon/headtail.c @@ -32,20 +32,18 @@ headtail (const char *prog, const char *flag, const char *n, char *path) { char *buf; char *out, *err; - int r, len; + int r; char **lines; NEED_ROOT (NULL); ABS_PATH (path, NULL); /* Make the path relative to /sysroot. */ - len = strlen (path) + 9; - buf = malloc (len); + buf = sysroot_path (path); if (!buf) { reply_with_perror ("malloc"); return NULL; } - snprintf (buf, len, "/sysroot%s", path); r = command (&out, &err, prog, flag, n, buf, NULL); free (buf);