From ccbb98e64a2d762eb9ba1904b861ec48b917eb2d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 21 Jan 2013 13:45:27 +0100 Subject: [PATCH] Use String::ToString() in CompatComponent::ProcessCommand(). --- components/compat/compatcomponent.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index cad4442b5..5f933866c 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -155,7 +155,14 @@ void CompatComponent::ProcessCommand(const String& command) String timestamp = command.SubStr(1, pos - 1); String args = command.SubStr(pos + 2, String::NPos); - double ts = strtod(timestamp.CStr(), NULL); + double ts = timestamp.ToDouble(); + + if (ts == 0) { + Logger::Write(LogWarning, "compat", "Invalid timestamp in command: " + command); + + return; + } + vector argv = args.Split(is_any_of(";")); if (argv.size() == 0) {