git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change strncmp() == 0 to STREQLEN()
[libguestfs.git]
/
daemon
/
daemon.h
diff --git
a/daemon/daemon.h
b/daemon/daemon.h
index
3f4c480
..
ac68479
100644
(file)
--- 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 { \
*/
#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; \
} \
reply_with_error ("%s: %s: expecting a device name", __func__, (path)); \
fail_stmt; \
} \
@@
-184,7
+184,7
@@
extern void reply (xdrproc_t xdrp, char *ret);
*/
#define REQUIRE_ROOT_OR_RESOLVE_DEVICE(path,fail_stmt) \
do { \
*/
#define REQUIRE_ROOT_OR_RESOLVE_DEVICE(path,fail_stmt) \
do { \
- if (
strncmp ((path), "/dev/", 5) == 0)
\
+ if (
STREQLEN ((path), "/dev/", 5))
\
RESOLVE_DEVICE ((path), fail_stmt); \
else { \
NEED_ROOT (fail_stmt); \
RESOLVE_DEVICE ((path), fail_stmt); \
else { \
NEED_ROOT (fail_stmt); \