X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=daemon%2Fupload.c;h=7b2ccea55241fbcaffdb8e08b51d7a71989e3f0a;hb=2d9953097b6d3b71122d444a4550047e97aee009;hp=da86bd65575dfe64fc0ffc61221aa773abca03f6;hpb=d1c35f871022e40f9abd93048c1115c6565f94cb;p=libguestfs.git diff --git a/daemon/upload.c b/daemon/upload.c index da86bd6..7b2ccea 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 = STREQLEN (filename, "/dev/", 5); 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 = STREQLEN (filename, "/dev/", 5); if (!is_dev) CHROOT_IN; fd = open (filename, O_RDONLY);