summaryrefslogtreecommitdiff
path: root/util/text.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2010-07-02 18:18:01 -0400
committerMathias Stearn <mathias@10gen.com>2010-07-02 18:18:01 -0400
commitd0607abb0007c392bc1c6b9da000bf98c204caf6 (patch)
tree9a588997ce2029af994fb0e7a0daa969bb2cf37b /util/text.h
parent5306963c75645645a5c1e6002519f5c0b2a31e85 (diff)
downloadmongo-d0607abb0007c392bc1c6b9da000bf98c204caf6.tar.gz
Try to fix NumberLong on win32
Diffstat (limited to 'util/text.h')
-rw-r--r--util/text.h10
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;
}