summaryrefslogtreecommitdiff
path: root/lib/util/util_str.c
AgeCommit message (Collapse)AuthorFilesLines
2022-12-14lib: Move talloc_asprintf_addbuf() to tallocVolker Lendecke1-23/+0
I wanted to use this in debug.c, but this would have meant to pollute debug's deps with a lot of stuff. Also, looking through uses of talloc_asprint_append(), very many of those don't do NULL checks properly and could benefit from the _addbuf() flavor. We can add a vasprintf variant later if the need shows up. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-07-25lib: Remove a few #include "includes.h"Volker Lendecke1-1/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-06-09lib/util: Move memcmp_const_time() to util.cJoseph Sutton1-12/+0
This allows it to be used in more places without needing to introduce more dependencies. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-10-08lib: Add talloc_asprintf_addbuf()Volker Lendecke1-0/+23
Simplifies building up a string step by step, see next commit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-01-12lib: Move utf16_len[_n]() to lib/util/charset/Volker Lendecke1-31/+0
util_unistr.c references it, avoid broken dependencies Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-03lib: relicense smb_strtoul(l) under LGPLv3Ralph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 3 22:21:04 UTC 2020 on sn-devel-184
2019-06-30lib: Update all consumers of strtoul_err(), strtoull_err() to new APISwen Schillig1-4/+3
Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2019-04-11common-lib: Update error check for new string conversion wrapperSwen Schillig1-2/+2
The new string conversion wrappers detect and flag errors which occured during the string to integer conversion. Those modifications required an update of the callees error checks. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
2019-03-01common-lib: Use wrapper for string to integer conversionSwen Schillig1-4/+6
In order to detect an value overflow error during the string to integer conversion with strtoul/strtoull, the errno variable must be set to zero before the execution and checked after the conversion is performed. This is achieved by using the wrapper function strtoul_err and strtoull_err. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-04-19util: Add memcmp_const_time()Andreas Schneider1-0/+12
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-19lib/util: Return some functions to util_str.cMartin Schwenke1-0/+55
These were moved in commit 8e704e4107b284bfc1e43f4c698ac0e6c5ae1800 when util_str.c was not shared. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Sep 19 20:34:05 CEST 2014 on sn-devel-104
2014-09-19lib/util: Move next_token* functions to util_str.cMartin Schwenke1-0/+145
This is part of an attempt to untangle charset from util.c. Most of this was moved from util_str.c in commit 55903e6f9120f1ec58a8554813229975c3028a09. next_token() was moved from charset to util.c in commit 4be643d4ce33d5ce2bf9deacc3f6d0fde90cf626 so that it would be alongside next_token_talloc(). Now that util_str.c is in shared lib/util it is no longer necessary to have these in util.c. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
2012-02-10lib/util: Remove unused str_format_nbt_domain()Andrew Bartlett1-35/+0
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html Andrew Bartlett
2011-05-04I added them, so I get to kill them :-). Finally remove all uses of ↵Jeremy Allison1-71/+0
safe_strcpy and safe_strcat. Change to strlcpy, strlcat. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed May 4 22:14:14 CEST 2011 on sn-devel-104
2011-05-03lib/util Use lib/util/util_str.c in common, including strequal()Andrew Bartlett1-1/+1
strequal() is now implemented in terms of strcasecmp_m() which is tested in smbtorture and which does not talloc() for ASCII or non-ASCII comparions, and has an ASCII fast-path. Andrew Bartlett
2011-05-03lib/util Use compiler-checked safe string macros in top level code.Andrew Bartlett1-33/+23
This brings the 'safe' macros to the top level code, and removes duplication of the safe_strcpy() and safe_strcat() functions. Andrew Bartlett
2011-04-30lib/util Rename conv_str_size() -> conv_str_size_error()Andrew Bartlett1-1/+1
2011-04-13lib/util: Make string_replace from s3 commonAndrew Bartlett1-10/+0
The s4 implementation didn't do multibyte strings, so was only good for '/' which is known to be safe in all multibyte charsets. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util ucs2_align is identical, put it in commonAndrew Bartlett1-7/+0
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13lib/util Move simple string routines into common code.Andrew Bartlett1-54/+0
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-03-30lib/util Move base64 functions into lib/util/base64.cAndrew Bartlett1-2/+0
Andrew Bartlett
2011-02-18s4-util: removed the valgrind_strlen() routineAndrew Tridgell1-11/+0
this was for a bug in valgrind from 7 years ago. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-02Change uint_t to unsigned int in lib/utilMatt Kraai1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-01-19util_str: setup the correct talloc name for stringsStefan Metzmacher1-0/+2
metze (partly from samba4wins tree 447e7f9532131117e896712db9def321c96718eb)
2008-10-19Move more functions out of util_str.c into the shared util.c.Jelmer Vernooij1-299/+20
2008-10-19Move SMB-specific attribute function to SMB client library.Jelmer Vernooij1-46/+2
2008-10-18lib/util: fix strhex_to_data_blob to use data_blob_talloc.Günther Deschner1-1/+1
Jelmer, I'm pretty sure you wanted to do this. Please check. Guenther
2008-10-18Add extra parameter consistent with samba3.Jelmer Vernooij1-5/+9
2008-10-18Merge branch 'master' of ssh://git.samba.org/data/git/sambaJelmer Vernooij1-138/+0
2008-10-18Add TALLOC_CTX pointer to strhex_to_data_blob for consistency with SambaJelmer Vernooij1-2/+2
3.
2008-10-18Move substitute functions to a different file.Jelmer Vernooij1-138/+0
2008-10-11Move lib/util from source4 to top-level libutil.Jelmer Vernooij1-0/+790
Conflicts: source4/Makefile