From: Victor Julien Date: Wed, 26 Sep 2012 05:17:54 +0000 (+0200) Subject: Minor parsing cleanups in detect-engine options. X-Git-Tag: suricata-1.4beta2~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0c43a8a1c872fa1d85360f750d0235705a6911b;p=thirdparty%2Fsuricata.git Minor parsing cleanups in detect-engine options. --- diff --git a/src/detect-engine.c b/src/detect-engine.c index 0f280cd86e..826302933f 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -502,7 +502,7 @@ static uint8_t DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx) { if (de_ctx_custom != NULL) { TAILQ_FOREACH(opt, &de_ctx_custom->head, next) { - if (strncmp(opt->val, "profile", 3) == 0) { + if (strcmp(opt->val, "profile") == 0) { de_ctx_profile = opt->head.tqh_first->val; } else if (strcmp(opt->val, "sgh-mpm-context") == 0) { sgh_mpm_context = opt->head.tqh_first->val; @@ -511,13 +511,13 @@ static uint8_t DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx) { } if (de_ctx_profile != NULL) { - if (strncmp(de_ctx_profile, "low", 3) == 0) { + if (strcmp(de_ctx_profile, "low") == 0) { profile = ENGINE_PROFILE_LOW; - } else if (strncmp(de_ctx_profile, "medium", 6) == 0) { + } else if (strcmp(de_ctx_profile, "medium") == 0) { profile = ENGINE_PROFILE_MEDIUM; - } else if (strncmp(de_ctx_profile, "high", 4) == 0) { + } else if (strcmp(de_ctx_profile, "high") == 0) { profile = ENGINE_PROFILE_HIGH; - } else if (strncmp(de_ctx_profile, "custom", 4) == 0) { + } else if (strcmp(de_ctx_profile, "custom") == 0) { profile = ENGINE_PROFILE_CUSTOM; }