diff --git a/src/calibre/devices/linux_mount_helper.c b/src/calibre/devices/linux_mount_helper.c index 9fda0e9401..badcf0ac54 100644 --- a/src/calibre/devices/linux_mount_helper.c +++ b/src/calibre/devices/linux_mount_helper.c @@ -39,12 +39,12 @@ int check_args(const char *dev, const char *mp) { return False; } - if (strncmp("/media/", mp, 6) != 0) { + if (strncmp("/media/", mp, strlen("/media/")) != 0) { fprintf(stderr, "Trying to operate on a mount point not under /media is not allowed\n"); return False; } - if (strncmp("/dev/", dev, 5) != 0) { + if (strncmp("/dev/", dev, strlen("/dev/")) != 0) { fprintf(stderr, "Trying to operate on a dev node not under /dev\n"); return False; }