diff --git a/db/db.cpp b/db/db.cpp index fed81c31e69..67c4ca1a76b 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -574,7 +574,7 @@ int main(int argc, char* argv[], char *envp[] ) assert(opIdMem > 0); } else if ( s == "--deDupMem" ) { - long x = strtoll( argv[ ++i ], 0, 10 ); + long x = strtol( argv[ ++i ], 0, 10 ); uassert("bad arg", x > 0); IdSet::maxSize_ = x; assert(IdSet::maxSize_ > 0); diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index 08e74469fea..a1eca14ef48 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -1,5 +1,6 @@ // engine_spidermonkey.cpp +#include "stdafx.h" #include "engine_spidermonkey.h" #include "../client/dbclient.h" @@ -682,8 +683,9 @@ namespace mongo { jsval rval; int nargs = args.nFields(); - jsval smargs[nargs]; - + auto_ptr smargsPtr( new jsval[nargs] ); + jsval* smargs = smargsPtr.get(); + BSONObjIterator it( args ); for ( int i=0; itoval( it.next() );