build_docs: Use 'make distclean' instead of 'make clean'.
[sfrench/samba-autobuild/.git] / examples / VFS / shadow_copy_test.c
index d2b7206cd35a6b0f7ba31326e879dc58dc360991..1ba46b71762d123882729027beabb5d95ead27b8 100644 (file)
@@ -5,7 +5,7 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *  
  * This program is distributed in the hope that it will be useful,
  * (at your option) any later version.
  *  
  * This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License
  * GNU General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "includes.h"
  */
 
 #include "includes.h"
@@ -50,7 +49,7 @@
          Directories are always displayed...    
 */
 
          Directories are always displayed...    
 */
 
-static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
+static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
 {
        uint32 num = 3;
        uint32 i;
 {
        uint32 num = 3;
        uint32 i;
@@ -58,7 +57,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->num_volumes = num;
        
        if (labels) {   
-               shadow_copy_data->labels = (SHADOW_COPY_LABEL *)talloc_zero(shadow_copy_data->mem_ctx,(num)*sizeof(SHADOW_COPY_LABEL));
+               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);
                }
                for (i=0;i<num;i++) {
                        snprintf(shadow_copy_data->labels[i], sizeof(SHADOW_COPY_LABEL), "@GMT-2003.08.05-12.%02u.00",i);
                }