summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorNathan Brown <nathan.brown@10gen.com>2019-06-06 10:39:58 -0400
committerNathan Brown <nathan.brown@10gen.com>2019-06-27 10:04:18 -0400
commit0fefcf84347a2bcc4961baec0295b9d04047d86f (patch)
treece86921e5b14ee83a00400f4f4e8712093505cb8 /src/mongo/shell
parenta700238800aa2bf1e10c255337ec35373ffd2667 (diff)
downloadmongo-0fefcf84347a2bcc4961baec0295b9d04047d86f.tar.gz
SERVER-7143 replace standard library number parsing with custom NumberParser
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/shell_utils_launcher.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
index 60a78f9a38d..8cdedda01e6 100644
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -314,7 +314,8 @@ ProgramRunner::ProgramRunner(const BSONObj& args, const BSONObj& env, bool isMon
if (str == "--port") {
_port = -2;
} else if (_port == -2) {
- _port = strtol(str.c_str(), nullptr, 10);
+ if (!NumberParser::strToAny(10)(str, &_port).isOK())
+ _port = 0; // same behavior as strtol
} else if (isMongodProgram && str == "--configsvr") {
_name = "c";
}