The endptr is never NULL, so here we hopefully do the right thing.
if (strcmp(uname, name) == 0) {
id = strtoul(idstr, &tail, 10);
if (strcmp(uname, name) == 0) {
id = strtoul(idstr, &tail, 10);
id = -1;
else
dbg("id for '%s' is '%li'", name, id);
id = -1;
else
dbg("id for '%s' is '%li'", name, id);
if (isdigit(*str[0])) {
num = (int) strtoul(*str, &tail, 10);
if (isdigit(*str[0])) {
num = (int) strtoul(*str, &tail, 10);
*str = tail;
dbg("format length=%i", num);
return num;
*str = tail;
dbg("format length=%i", num);
return num;