summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <christian.ambach@de.ibm.com>2010-04-21 15:10:39 +0200
committerVolker Lendecke <vl@samba.org>2010-08-04 13:56:12 +0200
commitf4e60b42d37b5136dfd124de8bb5c1c9cd084957 (patch)
treebfc3b71157c50074cb1f9fe1a9d9d51d201ea9f2
parentb77f241b28bcf29a88e28a49623a5e99a356bb34 (diff)
downloadsamba-f4e60b42d37b5136dfd124de8bb5c1c9cd084957.tar.gz
samba-f4e60b42d37b5136dfd124de8bb5c1c9cd084957.tar.bz2
samba-f4e60b42d37b5136dfd124de8bb5c1c9cd084957.zip
small optimizations for shadowcopy2 module
- remove a compiler warning - replace strlen usage Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
-rw-r--r--source3/modules/vfs_shadow_copy2.c4
1 files changed, 2 insertions, 2 deletions
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) {