diff options
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r-- | xlators/nfs/server/src/nfs-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c index ec76c294f01..21093d71197 100644 --- a/xlators/nfs/server/src/nfs-common.c +++ b/xlators/nfs/server/src/nfs-common.c @@ -88,7 +88,7 @@ nfs_mntpath_to_xlator (xlator_list_t *cl, char *path) { char volname[MNTPATHLEN]; char *volptr = NULL; - int pathlen = 0; + size_t pathlen; xlator_t *targetxl = NULL; if ((!cl) || (!path)) @@ -102,7 +102,7 @@ nfs_mntpath_to_xlator (xlator_list_t *cl, char *path) else volptr = &volname[0]; - if (volname[pathlen - 1] == '/') + if (pathlen && volname[pathlen - 1] == '/') volname[pathlen - 1] = '\0'; while (cl) { |