diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-10-21 14:17:58 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-10-21 14:17:58 -0400 |
commit | feb2a40d5ff3990c06a2cf8885ac964541163480 (patch) | |
tree | 5780a47db5de7e6bdd4286962ab840237bffc9b4 /tools | |
parent | b446a74aec8e842f6caa638b9c4e80c6d6936df8 (diff) | |
download | mongo-feb2a40d5ff3990c06a2cf8885ac964541163480.tar.gz |
use lexical_cast instead of atoll b/c of windows
Diffstat (limited to 'tools')
-rw-r--r-- | tools/import.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/import.cpp b/tools/import.cpp index 01355fc4ae4..339496c84d3 100644 --- a/tools/import.cpp +++ b/tools/import.cpp @@ -74,8 +74,13 @@ class Import : public Tool { return true; } - b.append( fieldName , atoll( data.c_str() ) ); - return true; + try { + b.append( fieldName , boost::lexical_cast<long long>( data ) ); + return true; + } + catch(bad_lexical_cast &){ + return false; + } } void _append( BSONObjBuilder& b , const string& fieldName , const string& data ){ |