Use strtoumax() instead of strtoul() for id/ref attr in XML elements.

This improves compatibility when running an ILP32 binary on LP64 kernel.

Spotted by:	gjb
This commit is contained in:
Hiroki Sato 2013-07-12 02:36:00 +00:00
parent b27b6b66c0
commit aae0d5e549
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253247

View File

@ -75,10 +75,10 @@ StartElement(void *userData, const char *name, const char **attr)
ref = NULL;
for (i = 0; attr[i] != NULL; i += 2) {
if (!strcmp(attr[i], "id")) {
id = (void *)strtoul(attr[i + 1], NULL, 0);
id = (void *)strtoumax(attr[i + 1], NULL, 0);
mt->nident++;
} else if (!strcmp(attr[i], "ref")) {
ref = (void *)strtoul(attr[i + 1], NULL, 0);
ref = (void *)strtoumax(attr[i + 1], NULL, 0);
} else
printf("%*.*s[%s = %s]\n",
mt->level + 1, mt->level + 1, "",