summaryrefslogtreecommitdiffstats
path: root/lib/libgeom
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2013-07-12 02:36:00 +0000
committerhrs <hrs@FreeBSD.org>2013-07-12 02:36:00 +0000
commit7b04a1affb3939db7d1e534bb88b1c9712c3c311 (patch)
treeed369ae6214109824151fe7a0a70d55d737d1e5c /lib/libgeom
parent1a38eadae75759280e35b93ed5683f224eaed451 (diff)
downloadFreeBSD-src-7b04a1affb3939db7d1e534bb88b1c9712c3c311.zip
FreeBSD-src-7b04a1affb3939db7d1e534bb88b1c9712c3c311.tar.gz
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
Diffstat (limited to 'lib/libgeom')
-rw-r--r--lib/libgeom/geom_xml2tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c
index 02be019..1b1ce4f 100644
--- a/lib/libgeom/geom_xml2tree.c
+++ b/lib/libgeom/geom_xml2tree.c
@@ -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, "",
OpenPOWER on IntegriCloud