Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2013 02:36:00 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253247 - head/lib/libgeom
Message-ID:  <201307120236.r6C2a0nQ018966@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Fri Jul 12 02:36:00 2013
New Revision: 253247
URL: http://svnweb.freebsd.org/changeset/base/253247

Log:
  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

Modified:
  head/lib/libgeom/geom_xml2tree.c

Modified: head/lib/libgeom/geom_xml2tree.c
==============================================================================
--- head/lib/libgeom/geom_xml2tree.c	Fri Jul 12 02:28:35 2013	(r253246)
+++ head/lib/libgeom/geom_xml2tree.c	Fri Jul 12 02:36:00 2013	(r253247)
@@ -75,10 +75,10 @@ StartElement(void *userData, const char 
 	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, "",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307120236.r6C2a0nQ018966>