Author: jra
Date: 2007-04-30 03:38:19 +0000 (Mon, 30 Apr 2007)
New Revision: 22591

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22591

Log:
Fix up the examples also.
Jeremy.

Modified:
   branches/SAMBA_3_0/examples/VFS/shadow_copy_test.c
   branches/SAMBA_3_0_25/examples/VFS/shadow_copy_test.c


Changeset:
Modified: branches/SAMBA_3_0/examples/VFS/shadow_copy_test.c
===================================================================
--- branches/SAMBA_3_0/examples/VFS/shadow_copy_test.c  2007-04-30 02:51:26 UTC 
(rev 22590)
+++ branches/SAMBA_3_0/examples/VFS/shadow_copy_test.c  2007-04-30 03:38:19 UTC 
(rev 22591)
@@ -58,7 +58,11 @@
        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);
                }

Modified: branches/SAMBA_3_0_25/examples/VFS/shadow_copy_test.c
===================================================================
--- branches/SAMBA_3_0_25/examples/VFS/shadow_copy_test.c       2007-04-30 
02:51:26 UTC (rev 22590)
+++ branches/SAMBA_3_0_25/examples/VFS/shadow_copy_test.c       2007-04-30 
03:38:19 UTC (rev 22591)
@@ -58,7 +58,11 @@
        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);
                }

Reply via email to