diff mbox

[06/10] mountd: Avoid unnecessary type conversions

Message ID 20121022160633.4552.55174.stgit@lebasque.1015granger.net (mailing list archive)
State New, archived
Headers show

Commit Message

Chuck Lever Oct. 22, 2012, 4:06 p.m. UTC
Clean up compiler warnings:

cache.c: In function ‘is_subdirectory’:
cache.c:760:16: warning: conversion to ‘int’ from ‘size_t’ may
  alter its value [-Wconversion]
cache.c:763:3: warning: conversion to ‘size_t’ from ‘int’ may
  change the sign of the result [-Wsign-conversion]

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mountd/cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 64ca5ba..fbaa28e 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -758,7 +758,7 @@  static int dump_to_cache(FILE *f, char *domain, char *path, struct exportent *ex
 
 static int is_subdirectory(char *child, char *parent)
 {
-	int l = strlen(parent);
+	size_t l = strlen(parent);
 
 	return strcmp(child, parent) == 0
 		|| (strncmp(child, parent, l) == 0 && child[l] == '/');