X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fupload.c;h=fdb86549b3b7277d12418269344bb45a31c913da;hb=f1dc74b8d605c07f4b8d4ca0b8dcf3db8c18edd1;hp=da86bd65575dfe64fc0ffc61221aa773abca03f6;hpb=d1c35f871022e40f9abd93048c1115c6565f94cb;p=libguestfs.git diff --git a/daemon/upload.c b/daemon/upload.c index da86bd6..fdb8654 100644 --- a/daemon/upload.c +++ b/daemon/upload.c @@ -40,7 +40,7 @@ do_upload (const char *filename) { int err, fd, r, is_dev; - is_dev = strncmp (filename, "/dev/", 5) == 0; + is_dev = STRPREFIX (filename, "/dev/"); if (!is_dev) { if (!root_mounted || filename[0] != '/') { cancel_receive (); @@ -93,7 +93,7 @@ do_download (const char *filename) int fd, r, is_dev; char buf[GUESTFS_MAX_CHUNK_SIZE]; - is_dev = strncmp (filename, "/dev/", 5) == 0; + is_dev = STRPREFIX (filename, "/dev/"); if (!is_dev) CHROOT_IN; fd = open (filename, O_RDONLY);