char *p;
char s[64]; /* Much longer than INET6_ADDRSTRLEN */
unsigned port;
- char *endp = NULL;
size_t len;
int ret;
return EINVAL;
}
- port = strtoul_err(p+1, &endp, 10, &ret);
- if (ret != 0 || *endp != '\0') {
+ port = smb_strtoul(p+1, NULL, 10, &ret, SMB_STR_FULL_STR_CONV);
+ if (ret != 0) {
/* Empty string or trailing garbage */
return EINVAL;
}
char *p;
char s[64]; /* Much longer than INET6_ADDRSTRLEN */
unsigned int m;
- char *endp = NULL;
ssize_t len;
int ret = 0;
return EINVAL;
}
- m = strtoul_err(p+1, &endp, 10, &ret);
- if (ret != 0 || *endp != '\0') {
+ m = smb_strtoul(p+1, NULL, 10, &ret, SMB_STR_FULL_STR_CONV);
+ if (ret != 0) {
/* Empty string or trailing garbage */
return EINVAL;
}
while (tok != NULL) {
uint32_t pnn;
- pnn = (uint32_t)strtoul_err(tok, NULL, 0, &error);
+ pnn = (uint32_t)smb_strtoul(tok,
+ NULL,
+ 0,
+ &error,
+ SMB_STR_STANDARD);
if (error != 0) {
fprintf(stderr, "Invalid node %s\n", tok);
return false;
}
if (strncmp(db_arg, "0x", 2) == 0) {
- id = strtoul_err(db_arg, NULL, 0, &ret);
+ id = smb_strtoul(db_arg, NULL, 0, &ret, SMB_STR_STANDARD);
if (ret != 0) {
return false;
}
}
tunable.name = argv[0];
- tunable.value = strtoul_err(argv[1], NULL, 0, &ret);
+ tunable.value = smb_strtoul(argv[1], NULL, 0, &ret, SMB_STR_STANDARD);
if (ret != 0) {
return ret;
}
pid = atoi(argv[0]);
if (argc == 2) {
- srvid = strtoull_err(argv[1], NULL, 0, &ret);
+ srvid = smb_strtoull(argv[1], NULL, 0, &ret, SMB_STR_STANDARD);
if (ret != 0) {
return ret;
}
}
ban_state.pnn = ctdb->cmd_pnn;
- ban_state.time = strtoul_err(argv[0], NULL, 0, &ret);
+ ban_state.time = smb_strtoul(argv[0], NULL, 0, &ret, SMB_STR_STANDARD);
if (ret != 0) {
return ret;
}
}
if (argc == 2) {
- port = strtoul_err(argv[1], NULL, 10, &ret);
+ port = smb_strtoul(argv[1], NULL, 10, &ret, SMB_STR_STANDARD);
if (ret != 0) {
return ret;
}
return 1;
}
- pnn = strtoul_err(argv[1], NULL, 10, &ret);
+ pnn = smb_strtoul(argv[1], NULL, 10, &ret, SMB_STR_STANDARD);
if (pnn == CTDB_UNKNOWN_PNN || ret != 0) {
fprintf(stderr, "Invalid PNN %s\n", argv[1]);
return 1;
ZERO_STRUCT(header);
if (argc > 3) {
- header.rsn = (uint64_t)strtoull_err(argv[3], NULL, 0, &ret);
+ header.rsn = (uint64_t)smb_strtoull(argv[3],
+ NULL,
+ 0,
+ &ret,
+ SMB_STR_STANDARD);
if (ret != 0) {
return ret;
}
ctdb_timeout = getenv("CTDB_TIMEOUT");
if (ctdb_timeout != NULL) {
- options.maxruntime = strtoul_err(ctdb_timeout, NULL, 0, &ret);
+ options.maxruntime = smb_strtoul(ctdb_timeout,
+ NULL,
+ 0,
+ &ret,
+ SMB_STR_STANDARD);
if (ret != 0) {
fprintf(stderr, "Invalid value CTDB_TIMEOUT\n");
exit(1);