summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/daemon.h2
-rw-r--r--daemon/guestfsd.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 3f4c4807..1cdb4800 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -164,7 +164,7 @@ extern void reply (xdrproc_t xdrp, char *ret);
*/
#define RESOLVE_DEVICE(path,fail_stmt) \
do { \
- if (strncmp ((path), "/dev/", 5) != 0) { \
+ if (STRNEQLEN ((path), "/dev/", 5)) { \
reply_with_error ("%s: %s: expecting a device name", __func__, (path)); \
fail_stmt; \
} \
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index d16826f0..61a62368 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -945,7 +945,7 @@ device_name_translation (char *device, const char *func)
}
/* If the name begins with "/dev/sd" then try the alternatives. */
- if (strncmp (device, "/dev/sd", 7) != 0)
+ if (STRNEQLEN (device, "/dev/sd", 7))
goto error;
device[5] = 'h'; /* /dev/hd (old IDE driver) */