From f4e60b42d37b5136dfd124de8bb5c1c9cd084957 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Wed, 21 Apr 2010 15:10:39 +0200 Subject: small optimizations for shadowcopy2 module - remove a compiler warning - replace strlen usage Signed-off-by: Christian Ambach --- source3/modules/vfs_shadow_copy2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 34792de97b..502f815235 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -436,7 +436,7 @@ static char *convert_shadow2_name(vfs_handle_struct *handle, const char *fname, } prefix = talloc_asprintf(tmp_ctx, "%s/@GMT-", snapdir); - if (strncmp(fname, prefix, strlen(prefix)) == 0) { + if (strncmp(fname, prefix, (talloc_get_size(prefix)-1)) == 0) { /* this looks like as we have already normalized it, leave it untouched*/ talloc_free(tmp_ctx); return talloc_strdup(handle->data, fname); @@ -659,7 +659,7 @@ static char *shadow_copy2_realpath(vfs_handle_struct *handle, if (shadow_copy2_match_name(fname, &gmt) && (gmt[GMT_NAME_LEN] == '\0')) { - char *copy, *result; + char *copy; copy = talloc_strdup(talloc_tos(), fname); if (copy == NULL) { -- cgit