svn commit: samba r1758 - in branches/SAMBA_4_0/source: lib torture/rpc

idra at samba.org idra at samba.org
Thu Aug 12 06:30:10 GMT 2004


Author: idra
Date: 2004-08-12 06:30:03 +0000 (Thu, 12 Aug 2004)
New Revision: 1758
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=1758&nolog=1
Log:

Move and enhance the add_string_to_array function as per volker job on trunk


Modified:
   branches/SAMBA_4_0/source/lib/util_str.c
   branches/SAMBA_4_0/source/torture/rpc/samr.c

Changeset:
Modified: branches/SAMBA_4_0/source/lib/util_str.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util_str.c	2004-08-12 05:15:41 UTC (rev 1757)
+++ branches/SAMBA_4_0/source/lib/util_str.c	2004-08-12 06:30:03 UTC (rev 1758)
@@ -1446,3 +1446,21 @@
 
 	return ret;
 }
+
+BOOL add_string_to_array(TALLOC_CTX *mem_ctx,
+			 const char *str, const char ***strings, int *num)
+{
+	char *dup_str = talloc_strdup(mem_ctx, str);
+
+	*strings = talloc_realloc(mem_ctx, *strings,
+				  ((*num)+1) * sizeof(**strings));
+
+	if ((*strings == NULL) || (dup_str == NULL))
+		return False;
+
+	(*strings)[*num] = dup_str;
+	*num += 1;
+
+	return True;
+}
+

Modified: branches/SAMBA_4_0/source/torture/rpc/samr.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samr.c	2004-08-12 05:15:41 UTC (rev 1757)
+++ branches/SAMBA_4_0/source/torture/rpc/samr.c	2004-08-12 06:30:03 UTC (rev 1758)
@@ -2315,21 +2315,6 @@
 	return True;	
 }
 
-void add_string_to_array(TALLOC_CTX *mem_ctx,
-			 const char *str, const char ***strings, int *num)
-{
-	*strings = talloc_realloc(mem_ctx, *strings,
-				  ((*num)+1) * sizeof(**strings));
-
-	if (*strings == NULL)
-		return;
-
-	(*strings)[*num] = str;
-	*num += 1;
-
-	return;
-}
-
 /* Test whether querydispinfo level 5 and enumdomgroups return the same
    set of group names. */
 static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 



More information about the samba-cvs mailing list