summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorSwen Schillig <swen@linux.ibm.com>2019-06-04 09:04:15 +0200
committerRalph Boehme <slow@samba.org>2019-06-30 11:32:18 +0000
commita75727f191c53ca358cdef930b75d169793f59a3 (patch)
tree86c58f95cad32a1a72f32a7eb328a35704d3126f /source3/utils
parentbf020a8c8db6bb6a0386d3bf69d40116601b1aca (diff)
downloadsamba-a75727f191c53ca358cdef930b75d169793f59a3.tar.gz
source3: Update all consumers of strtoul_err(), strtoull_err() to new API
Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_idmap.c5
-rw-r--r--source3/utils/net_registry.c8
-rw-r--r--source3/utils/net_rpc_registry.c2
-rw-r--r--source3/utils/net_sam.c9
-rw-r--r--source3/utils/pdbedit.c9
-rw-r--r--source3/utils/regedit_dialog.c5
6 files changed, 23 insertions, 15 deletions
diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c
index d1a6db95921..0aa45f742cd 100644
--- a/source3/utils/net_idmap.c
+++ b/source3/utils/net_idmap.c
@@ -627,11 +627,10 @@ done:
static bool parse_uint32(const char *str, uint32_t *result)
{
unsigned long val;
- char *endptr;
int error = 0;
- val = strtoul_err(str, &endptr, 10, &error);
- if (error != 0 || *endptr != '\0') {
+ val = smb_strtoul(str, NULL, 10, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
return false;
}
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c
index 74224ddbf15..c6a681de42b 100644
--- a/source3/utils/net_registry.c
+++ b/source3/utils/net_registry.c
@@ -512,7 +512,7 @@ static int net_registry_setvalue(struct net_context *c, int argc,
int error = 0;
uint32_t v;
- v = strtoul_err(argv[3], NULL, 10, &error);
+ v = smb_strtoul(argv[3], NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
@@ -650,7 +650,11 @@ static int net_registry_increment(struct net_context *c, int argc,
if (argc == 3) {
int error = 0;
- state.increment = strtoul_err(argv[2], NULL, 10, &error);
+ state.increment = smb_strtoul(argv[2],
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
goto done;
}
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 84936ee31ae..e47bad4e33f 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -606,7 +606,7 @@ static NTSTATUS rpc_registry_setvalue_internal(struct net_context *c,
int error = 0;
uint32_t v;
- v = strtoul_err(argv[3], NULL, 10, &error);
+ v = smb_strtoul(argv[3], NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
goto error;
}
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 164d9408c56..74e500f0f31 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -483,7 +483,6 @@ static int net_sam_policy_set(struct net_context *c, int argc, const char **argv
uint32_t value = 0;
uint32_t old_value = 0;
enum pdb_policy_type field;
- char *endptr;
int err = 0;
if (argc != 2 || c->display_usage) {
@@ -501,9 +500,13 @@ static int net_sam_policy_set(struct net_context *c, int argc, const char **argv
value = -1;
}
else {
- value = strtoul_err(argv[1], &endptr, 10, &err);
+ value = smb_strtoul(argv[1],
+ NULL,
+ 10,
+ &err,
+ SMB_STR_FULL_STR_CONV);
- if (err != 0 || *endptr != '\0') {
+ if (err != 0) {
d_printf(_("Unable to set policy \"%s\"! Invalid value "
"\"%s\".\n"),
account_policy, argv[1]);
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 462c753217e..74f8c3b0b2f 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -594,15 +594,18 @@ static int set_user_info(const char *username, const char *fullname,
}
if (kickoff_time) {
- char *endptr;
time_t value = get_time_t_max();
if (strcmp(kickoff_time, "never") != 0) {
int error = 0;
uint32_t num;
- num = strtoul_err(kickoff_time, &endptr, 10, &error);
- if (error != 0 || *endptr != '\0') {
+ num = smb_strtoul(kickoff_time,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
fprintf(stderr, "Failed to parse kickoff time\n");
return -1;
}
diff --git a/source3/utils/regedit_dialog.c b/source3/utils/regedit_dialog.c
index 7dd9f0fadea..c70dd44a743 100644
--- a/source3/utils/regedit_dialog.c
+++ b/source3/utils/regedit_dialog.c
@@ -1030,7 +1030,6 @@ bool dialog_section_text_field_get_uint(struct dialog_section *section,
unsigned long long *out)
{
const char *buf;
- char *endp;
int error = 0;
struct dialog_section_text_field *text_field =
talloc_get_type_abort(section, struct dialog_section_text_field);
@@ -1041,8 +1040,8 @@ bool dialog_section_text_field_get_uint(struct dialog_section *section,
if (buf == NULL) {
return false;
}
- *out = strtoull_err(buf, &endp, 0, &error);
- if (error != 0 || *endp != '\0') {
+ *out = smb_strtoull(buf, NULL, 0, &error, SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
return false;
}