Loading...
libkern/c++/OSUnserializeXML.cpp xnu-792 xnu-517.9.5
--- xnu/xnu-792/libkern/c++/OSUnserializeXML.cpp
+++ xnu/xnu-517.9.5/libkern/c++/OSUnserializeXML.cpp
@@ -1410,8 +1410,9 @@
 {
 	unsigned long long n = 0;
 	int base = 10;
-	bool negate = false;
 	int c = currentChar();
+
+	if (!isDigit (c)) return 0;
 
 	if (c == '0') {
 		c = nextChar();
@@ -1421,16 +1422,9 @@
 		}
 	}
 	if (base == 10) {
-		if (c == '-') {
-			negate = true;
-			c = nextChar();
-		}
 		while(isDigit(c)) {
 			n = (n * base + c - '0');
 			c = nextChar();
-		}
-		if (negate) {
-			n = (unsigned long long)((long long)n * (long long)-1);
 		}
 	} else {
 		while(isHexDigit(c)) {