util: allow hexadecimal values for attr_as_unsigned (fix ufs provisioning)

dc61f8f79e broke ufs provisioning by requiring base 10 for unsigned
attributes (provisioning xml have some values in hexadecimal). strtoul()
would return 0 for these values and provisioning would fail strangely.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
This commit is contained in:
Jonathan Marek
2021-02-27 12:17:19 -05:00
committed by Bjorn Andersson
parent 650b477ca5
commit ec6c8a034e

2
util.c
View File

@@ -91,7 +91,7 @@ unsigned attr_as_unsigned(xmlNode *node, const char *attr, int *errors)
return 0;
}
return (unsigned int) strtoul((char*)value, NULL, 10);
return (unsigned int) strtoul((char*)value, NULL, 0);
}
const char *attr_as_string(xmlNode *node, const char *attr, int *errors)