r22591: Fix up the examples also.
authorJeremy Allison <jra@samba.org>
Mon, 30 Apr 2007 03:38:19 +0000 (03:38 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:49 +0000 (12:19 -0500)
Jeremy.

examples/VFS/shadow_copy_test.c

index 155181229b190900532ce16c197d446fc5fc2acb..98ac304ee2c74138e7ed1304d3121649da268d5d 100644 (file)
@@ -58,7 +58,11 @@ static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs
        shadow_copy_data->num_volumes = num;
        
        if (labels) {   
-               shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num);
+               if (num) {
+                       shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num);
+               } else {
+                       shadow_copy_data->labels = NULL;
+               }
                for (i=0;i<num;i++) {
                        snprintf(shadow_copy_data->labels[i], sizeof(SHADOW_COPY_LABEL), "@GMT-2003.08.05-12.%02u.00",i);
                }