char *istr = strtok_r(str, sep, &saveptr); \
int error = 0;\
if ((istr) == NULL) return false; \
- (ret) = strtoul_err(istr, NULL, 10, &error); \
+ (ret) = smb_strtoul(istr, NULL, 10, &error, SMB_STR_STANDARD); \
if (error != 0) {\
return false;\
}\
}
errno = 0;
- blen = strtoul_err(p1, &p2, 10, &error);
+ blen = smb_strtoul(p1, &p2, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
DEBUG(10, (__location__ ": failed\n"));
goto failed;
memcpy(s, v->data, v->length);
s[v->length] = 0;
- *val = strtoull_err(s, NULL, 0, &error);
+ *val = smb_strtoull(s, NULL, 0, &error, SMB_STR_STANDARD);
if (error != 0) {
return NT_STATUS_INVALID_PARAMETER;
}
char s[v->length + 1];
memcpy(s, v->data, v->length);
s[v->length] = 0;
- *val = strtoul_err(s, NULL, 0, &error);
+ *val = smb_strtoul(s, NULL, 0, &error, SMB_STR_STANDARD);
if (error != 0) {
return NT_STATUS_INVALID_PARAMETER;
}
if (!p) {
return 0;
}
- flags = strtoul_err(p+11, &end, 10, &error);
+ flags = smb_strtoul(p+11, &end, 10, &error, SMB_STR_STANDARD);
if (!end || *end != '>' || error != 0) {
/* it must end in a > */
return 0;
* to update the max USN in the cookie if we
* decide to keep this entry
*/
- val = strtoull_err(
+ val = smb_strtoull(
(const char*)msg->elements[i].values[0].data,
NULL,
0,
- &error);
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
ldb_set_errstring(ldb,
"Failed to convert USN");
return ldb_module_oom(module);
}
- *value = strtoull_err(value_str, NULL, 10, &error);
+ *value = smb_strtoull(value_str, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
"partition_metadata: converision failed");
*/
static int verify_cidr(const char *cidr)
{
- char *address = NULL, *slash = NULL, *endptr = NULL;
+ char *address = NULL, *slash = NULL;
bool has_colon, has_dot;
int res, ret;
unsigned long mask;
/* terminate the address for strchr, inet_pton */
*slash = '\0';
- mask = strtoul_err(slash + 1, &endptr, 10, &error);
+ mask = smb_strtoul(slash + 1, NULL, 10, &error, SMB_STR_FULL_STR_CONV);
if (mask == 0){
DBG_INFO("Windows does not like the zero mask, "
"so nor do we: %s\n", cidr);
goto error;
}
- if (error != 0 || *endptr != '\0'){
+ if (error != 0){
DBG_INFO("CIDR mask is not a proper integer: %s\n", cidr);
goto error;
}
* next time
*/
data->tdb_seqnum = tdb_seqnum;
- data->schema_seq_num_cache = strtoull_err(value_str, NULL, 10, &error);
+ data->schema_seq_num_cache = smb_strtoull(value_str,
+ NULL,
+ 10,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
talloc_free(tmp_ctx);
return ldb_module_error(data->module, LDB_ERR_OPERATIONS_ERROR,
return WERR_INVALID_PARAMETER;
}
oid_subid++;
- last_subid = strtoul_err(oid_subid, NULL, 10, &error);
+ last_subid = smb_strtoul(oid_subid, NULL, 10, &error, SMB_STR_STANDARD);
if (error != 0) {
return WERR_INVALID_PARAMETER;
}
/* The data is a plain DWORD */
uint32_t tmp;
- tmp = strtoul_err((char *)val->data, NULL, 0, &error);
+ tmp = smb_strtoul((char *)val->data,
+ NULL,
+ 0,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
data->data = NULL;
data->length = 0;
/* The data is a plain QWORD */
uint64_t tmp;
- tmp = strtoull_err((char *)val->data, NULL, 0, &error);
+ tmp = smb_strtoull((char *)val->data,
+ NULL,
+ 0,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
data->data = NULL;
data->length = 0;
return;
}
} else {
- char *endp = NULL;
int error = 0;
- unsigned long val = strtoul_err(p, &endp, 0, &error);
- if (error != 0 || *endp != '\0') {
+ unsigned long val = smb_strtoul(p,
+ NULL,
+ 0,
+ &error,
+ SMB_STR_FULL_STR_CONV);
+ if (error != 0) {
DEBUG(2,("interpret_interface: "
"can't determine netmask value from %s\n",
p));
composite_error(c, NT_STATUS_OBJECT_NAME_NOT_FOUND);
return;
}
- port = strtoul_err(p, NULL, 10, &error);
+ port = smb_strtoul(p, NULL, 10, &error, SMB_STR_STANDARD);
if (port > UINT16_MAX || error != 0) {
composite_error(c, NT_STATUS_OBJECT_NAME_NOT_FOUND);
return;
if (comp_num > cur && strcasecmp("type", ldb_dn_get_component_name(dn, cur)) == 0) {
name->type =
- strtoul_err(
+ smb_strtoul(
(char *)ldb_dn_get_component_val(dn, cur)->data,
NULL,
0,
- &error);
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto failed;
flags = LDB_FLAG_MOD_ADD;
} else {
- orig_uint = strtoul_err((const char *)orig_val->data,
+ orig_uint = smb_strtoul((const char *)orig_val->data,
NULL,
0,
- &error);
+ &error,
+ SMB_STR_STANDARD);
if (error != 0 || orig_uint != value) {
/* replace also if can't get value */
flags = LDB_FLAG_MOD_REPLACE;
/* accept numeric or string status codes */
if (strncmp(params[i-1], "0x", 2) == 0) {
- tmp = strtoul_err(params[i-1], NULL, 16, &error);
+ tmp = smb_strtoul(params[i-1],
+ NULL,
+ 16,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
tmp = error;
}
sharemode = smb2_util_share_access(sharemode_string);
access_string = torture_setting_string(tctx, "access", "0xf01ff");
- access = strtoul_err(access_string, NULL, 0, &error);
+ access = smb_strtoul(access_string, NULL, 0, &error, SMB_STR_STANDARD);
if (error != 0) {
torture_comment(tctx, "Initializing access failed.\n");
return false;