diff options
author | Mathias Stearn <mathias@10gen.com> | 2010-07-02 18:18:01 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2010-07-02 18:18:01 -0400 |
commit | d0607abb0007c392bc1c6b9da000bf98c204caf6 (patch) | |
tree | 9a588997ce2029af994fb0e7a0daa969bb2cf37b /util/text.h | |
parent | 5306963c75645645a5c1e6002519f5c0b2a31e85 (diff) | |
download | mongo-d0607abb0007c392bc1c6b9da000bf98c204caf6.tar.gz |
Try to fix NumberLong on win32
Diffstat (limited to 'util/text.h')
-rw-r--r-- | util/text.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/util/text.h b/util/text.h index dc4098713e3..07db8082095 100644 --- a/util/text.h +++ b/util/text.h @@ -133,13 +133,9 @@ namespace mongo { } uassert( 13306, "could not convert string to long long", endLen != 0 && n[ endLen ] == 0 ); #else // stoll() wasn't introduced until VS 2010. - char* endPtr = (char *)&n[strlen(n) - 1]; - try { - ret = _strtoi64( n, &endPtr, 10 ); - } catch ( ... ) { - endPtr = 0; - } - uassert( 13310, "could not convert string to long long", *endPtr == 0 ); + char* endPtr = 0; + ret = _strtoi64( n, &endPtr, 10 ); + uassert( 13310, "could not convert string to long long", (*endPtr == 0) && (endPtr != _I64_MAX) && (endPtr != _I64_MIN) ); #endif // !defined(_WIN32) return ret; } |