Loading...
libkern/c++/OSNumber.cpp xnu-792.6.56 xnu-517
--- xnu/xnu-792.6.56/libkern/c++/OSNumber.cpp
+++ xnu/xnu-517/libkern/c++/OSNumber.cpp
@@ -2,6 +2,8 @@
  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
+ * 
+ * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
  * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
@@ -25,7 +27,7 @@
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-extern unsigned long strtoul(const char *, char **, int);
+extern int sscanf(const char *input, const char *fmt, ...);
 __END_DECLS
 
 #include <libkern/c++/OSNumber.h>
@@ -61,7 +63,18 @@
 
 bool OSNumber::init(const char *value, unsigned int numberOfBits)
 {
-    return init((unsigned long long)strtoul(value, NULL, 0), numberOfBits);
+    unsigned long long thisOffset;
+
+#ifdef q_works
+    sscanf(value, "%qi", thisOffset);
+#else
+    unsigned int smallOffset;
+
+    sscanf(value, "%i", &smallOffset);
+    thisOffset = smallOffset;
+#endif
+
+    return init(thisOffset, numberOfBits);
 }
 
 void OSNumber::free() { super::free(); }