X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fwc.c;h=4878b57e16d9441011bc7906eaea3b3c63be9190;hp=370ffddebbbcd804d1b3287f68242fd50e1f053a;hb=0f2e9c84e9ff1071260770930068642ecc8ac0d9;hpb=a7b73d4a1e09f12b2002083618056f0c823c1dcf diff --git a/daemon/wc.c b/daemon/wc.c index 370ffdd..4878b57 100644 --- a/daemon/wc.c +++ b/daemon/wc.c @@ -32,19 +32,17 @@ wc (char *flag, char *path) { char *buf; char *out, *err; - int r, len; + int r; NEED_ROOT (-1); ABS_PATH (path, -1); /* Make the path relative to /sysroot. */ - len = strlen (path) + 9; - buf = malloc (len); + buf = sysroot_path (path); if (!buf) { reply_with_perror ("malloc"); return -1; } - snprintf (buf, len, "/sysroot%s", path); r = command (&out, &err, "wc", flag, buf, NULL); free (buf);