diff options
author | Jim Meyering <meyering@redhat.com> | 2009-11-09 14:21:46 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-11-09 22:34:16 +0100 |
commit | 627f89351d06e43564b47ea42cabaa522284c2a1 (patch) | |
tree | 088ef0ed9661ac5f76e61373c899bfe2edce9d0b /daemon | |
parent | 29842da1379ece83eae98ee786b475ae161f1687 (diff) | |
download | libguestfs-627f89351d06e43564b47ea42cabaa522284c2a1.tar.gz libguestfs-627f89351d06e43564b47ea42cabaa522284c2a1.tar.xz libguestfs-627f89351d06e43564b47ea42cabaa522284c2a1.zip |
change strncmp(...) != 0 to STRNEQLEN(...)
git grep -l 'strncmp *([^=]*!= *0'|xargs \
perl -pi -e 's/\bstrncmp( *\(.*?\)) *!= *0/STRNEQLEN$1/g'
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/daemon.h | 2 | ||||
-rw-r--r-- | daemon/guestfsd.c | 2 |
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) */ |