From: Swen Schillig Date: Tue, 25 Jun 2019 08:25:08 +0000 (+0200) Subject: lib: Add flag definitions to control the internal string to int conversion routines X-Git-Tag: ldb-2.0.5~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7fd0cd02b75782dc6e9a4755d3404e738a92e719;p=thirdparty%2Fsamba.git lib: Add flag definitions to control the internal string to int conversion routines The following flags are defined intially SMB_STR_STANDARD # raise error if negative or non-numeric SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-" SMB_STR_FULL_STR_CONV # entire string must be converted SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul Signed-off-by: Swen Schillig Reviewed-by: Ralph Boehme Reviewed-by: Christof Schmitt --- diff --git a/lib/util/util.h b/lib/util/util.h index fcd81759b9c..2ed036358d0 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -21,6 +21,13 @@ #ifndef __UTIL_SAMBA_UTIL_H__ #define __UTIL_SAMBA_UTIL_H__ +#define SMB_STR_STANDARD 0x00 +#define SMB_STR_ALLOW_NEGATIVE 0x01 +#define SMB_STR_FULL_STR_CONV 0x02 +#define SMB_STR_ALLOW_NO_CONVERSION 0x04 +#define SMB_STR_GLIBC_STANDARD (SMB_STR_ALLOW_NO_CONVERSION | \ + SMB_STR_ALLOW_NEGATIVE) + unsigned long int strtoul_err(const char *nptr, char **endptr, int base, int *err);