diff --git a/pandora_agents/win32/misc/cron.cc b/pandora_agents/win32/misc/cron.cc index b1e70c9d88..d712c2685c 100644 --- a/pandora_agents/win32/misc/cron.cc +++ b/pandora_agents/win32/misc/cron.cc @@ -30,7 +30,16 @@ */ Cron::Cron (string cron_string) { char cron_params[5][256], bottom[256], top[256]; - + + // Check if cron string is the default or empty + if ( + cron_string.compare(CRON_DEFAULT_STRING) == 0 || + cron_string.compare("") == 0 + ) { + this->isSet = false; + return; + } + // Parse the cron string if (sscanf (cron_string.c_str (), "%255s %255s %255s %255s %255s", cron_params[0], cron_params[1], cron_params[2], cron_params[3], cron_params[4]) != 5) { Pandora::pandoraDebug ("Invalid cron string: %s", cron_string.c_str ()); @@ -40,12 +49,6 @@ Cron::Cron (string cron_string) { } this->cronString = cron_string; - - // Check if cron string is the default - if (cron_string.compare(CRON_DEFAULT_STRING) == 0) { - this->isSet = false; - return; - } // Fill the cron structure this->utimestamp = 0; diff --git a/pandora_agents/win32/modules/pandora_module_factory.cc b/pandora_agents/win32/modules/pandora_module_factory.cc index 308d5bb703..658ff724fd 100644 --- a/pandora_agents/win32/modules/pandora_module_factory.cc +++ b/pandora_agents/win32/modules/pandora_module_factory.cc @@ -1307,9 +1307,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { } /* Module cron */ - if (module_crontab != "") { - module->setCron (module_crontab); - } + module->setCron (module_crontab); /* Plugins do not have a module type */ if (module_plugin == "") {