1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

32 Commits

Author SHA1 Message Date
Volker Lendecke
c692b5c95b lib: Use talloc_asprintf_addbuf() in str_list_join_shell()
This adds proper NULL checks via talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 04:32:34 +00:00
Volker Lendecke
2c7766c28f lib: Use talloc_asprintf_addbuf() in str_list_join()
This adds intermediate NULL checks via talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 04:32:34 +00:00
Volker Lendecke
7870e82cb4 lib: Fix whitespace
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 04:32:34 +00:00
Volker Lendecke
ecf9ba381e lib: Add str_list_add_printf()
Build up execv argument lists

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-05-11 22:56:37 +00:00
Volker Lendecke
5212464bf1 lib: Simplify str_list_make_empty()
We have talloc_zero_array() for this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-05-11 22:56:37 +00:00
Martin Schwenke
abea597b7f util: Fix signed/unsigned comparisons by declaring as size_t
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-01 06:44:13 +00:00
Martin Schwenke
c1a75ab5a4 util: Make util_strlist.c standalone with its own header file
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-05 09:00:20 +01:00
Martin Schwenke
c4c1592408 util: Split str_list_make_v3() into separate file
str_list_make_v3() calls next_token_talloc(), which has deep
dependencies, so can't be used without dragging in a lot of code.  The
other functions in this file are generally useful and have minimal
dependencies.

So leave the easily reusable code and split out the more difficult
stuff.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-02-05 09:00:20 +01:00
Günther Deschner
ee8ddb8e02 lib/util: use size_t for add_string_to_array().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-11-17 17:34:05 +01:00
Stefan Metzmacher
c5db62c9a3 lib/util: add str_list_make_v3_const()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-14 23:27:04 +01:00
Garming Sam
cafd60732b param: Add null checks for upcoming str_list_make changes
In changing str_list_make to str_list_make_v3, the list can be NULL.
These are some additional checks to try to avoid any problems.

Where lists are dealt with, they typically check both if the list is
empty or the list is NULL.

Change-Id: I9012c31dbd9832ce877728bcb3346616ba64c4c5
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-07-07 23:32:35 +02:00
Garming Sam
98dbc38efa move str_list_make_v3 out of s3 code
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
Stefan Metzmacher
f03653e39a lib/util: fix const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:42 +02:00
Andrew Bartlett
2eea91957c lib/util Move simple string routines into common code.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Brad Hards
dd89dc2c31 Spelling fixes for libutil
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:35 +01:00
Andrew Tridgell
76a7382346 lib: use TYPESAFE_QSORT() in lib/ and libcli/ 2010-02-14 18:44:20 +11:00
Matthias Dieter Wallnöfer
012494b800 util/util_strlist - add a call "const_str_list" for making "unconst" lists "const" 2009-12-01 16:46:29 +11:00
Matthias Dieter Wallnöfer
94c33bdd72 util/strlist: Fix up "const" warnings in the string list and test code
This work I did using suggestions by Jelmer.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-20 16:50:47 +01:00
Kamen Mazdrashki
5b75201dbb util: str_list_unique() bugfix
j is actually the index of the last element in the list
size of the list though is j+1 <- to make room for the
terminating NULL element
2009-11-13 23:19:06 +11:00
Jeremy Allison
d1aa7d4796 Remove the const from the str_list_XXX functions that
allocate both list and containing strings. This fixes
problems that people have tried to cast away and are
not needed.
Jeremy.
2009-09-24 15:52:58 -07:00
Matthias Dieter Wallnöfer
41596d2c43 util_strlist: Add some more "const"s - small correction 2009-09-10 22:07:47 +02:00
Matthias Dieter Wallnöfer
7669bc3c89 util_strlist: Add some more "const"s 2009-09-10 07:27:15 +02:00
Volker Lendecke
074890b39e Remove two unused variables 2009-05-14 15:40:57 +02:00
Andrew Bartlett
a89bee4c98 Add new functions and tests: str_list_make_empty(), str_list_make_single() 2009-05-14 05:56:58 +10:00
Volker Lendecke
2467ae1b6a Clean up after Tridge's util_strlist changes 2009-05-03 13:46:44 +02:00
Andrew Tridgell
fd7c52231f added _const versions of some of the str_list_*() functions
These const versions don't copy the strings themselves, which
is useful when those strings point at known constant data (into the
schema in this case)
2009-04-09 14:28:38 +10:00
Andrew Tridgell
4f69d7067d added str_list_unique() and str_list_show()
I also undid some of the const changes from Andrew, as
they didn't in fact resolve the const warnings.
2009-04-09 13:44:27 +10:00
Andrew Bartlett
54f7523db1 Rework util_strlist prototypes to use a bit more and less const
Hopefully this produces less warnings, but it might produce more...

Andrew Bartlett
2009-04-08 23:18:13 +10:00
Andrew Tridgell
ef6c6ab4c6 added a str_list_append() function 2009-04-07 16:33:26 +10:00
Jelmer Vernooij
c4d3dc849f Add extra const. 2008-10-12 02:27:38 +02:00
Jelmer Vernooij
218f482fbf Use common strlist implementation in Samba 3 and Samba 4. 2008-10-12 00:56:56 +02:00
Jelmer Vernooij
caa4e42860 Move lib/util from source4 to top-level libutil.
Conflicts:

	source4/Makefile
2008-10-11 21:05:38 +02:00