git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build: fix test for --nocompress option
[libguestfs.git]
/
daemon
/
wc.c
diff --git
a/daemon/wc.c
b/daemon/wc.c
index
370ffdd
..
4878b57
100644
(file)
--- a/
daemon/wc.c
+++ b/
daemon/wc.c
@@
-32,19
+32,17
@@
wc (char *flag, char *path)
{
char *buf;
char *out, *err;
{
char *buf;
char *out, *err;
- int r
, len
;
+ int r;
NEED_ROOT (-1);
ABS_PATH (path, -1);
/* Make the path relative to /sysroot. */
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;
}
if (!buf) {
reply_with_perror ("malloc");
return -1;
}
- snprintf (buf, len, "/sysroot%s", path);
r = command (&out, &err, "wc", flag, buf, NULL);
free (buf);
r = command (&out, &err, "wc", flag, buf, NULL);
free (buf);