From 1df39b4c9d80d6e5a755dd6afbb91dc7bed9d731 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 4 Aug 2010 12:38:42 +0000 Subject: [PATCH] 2010-08-04 Ramon Novoa * modules/pandora_module.cc: Changed sscanf format strings. They did not seem to work well in native Windows. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3092 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/win32/ChangeLog | 5 +++++ pandora_agents/win32/modules/pandora_module.cc | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 865bb5b3e4..0bf278a4eb 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,8 @@ +2010-08-04 Ramon Novoa + + * modules/pandora_module.cc: Changed sscanf format strings. They did + not seem to work well in native Windows. + 2010-07-16 Dario Rodriguez * misc/pandora_file.cc: fixed unclosed directory with function closedir. diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc index 100c8cdb7f..8fbe683d0a 100644 --- a/pandora_agents/win32/modules/pandora_module.cc +++ b/pandora_agents/win32/modules/pandora_module.cc @@ -646,12 +646,12 @@ Pandora_Module::addCondition (string condition) { cond->value_2 = 0; /* Numeric comparison */ - if (sscanf (condition.c_str (), "%255s %lf %1023[^]", operation, &(cond->value_1), command) == 3) { + if (sscanf (condition.c_str (), "%255s %lf %1023[^\n]s", operation, &(cond->value_1), command) == 3) { cond->operation = operation; cond->command = command; this->condition_list->push_back (cond); /* Regular expression */ - } else if (sscanf (condition.c_str (), "=~ %1023s %1023[^]", string_value, command) == 2) { + } else if (sscanf (condition.c_str (), "=~ %1023s %1023[^\n]s", string_value, command) == 2) { cond->operation = "=~"; cond->string_value = string_value; cond->command = command; @@ -662,7 +662,7 @@ Pandora_Module::addCondition (string condition) { } this->condition_list->push_back (cond); /* Interval */ - } else if (sscanf (condition.c_str (), "(%lf , %lf) %1023[^]", &(cond->value_1), &(cond->value_2), command) == 3) { + } else if (sscanf (condition.c_str (), "(%lf , %lf) %1023[^\n]s", &(cond->value_1), &(cond->value_2), command) == 3) { cond->operation = "()"; cond->command = command; this->condition_list->push_back (cond);