diff --git a/src/detect-fileext.c b/src/detect-fileext.c index 223ebfc216..817a5fe859 100644 --- a/src/detect-fileext.c +++ b/src/detect-fileext.c @@ -116,9 +116,7 @@ static int DetectFileextMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, ret = 1; SCLogDebug("File ext found"); } - } - - if (ret == 0 && (fileext->flags & DETECT_CONTENT_NEGATED)) { + } else if (fileext->flags & DETECT_CONTENT_NEGATED) { SCLogDebug("negated match"); ret = 1; } diff --git a/src/detect-filename.c b/src/detect-filename.c index d39e661e74..56578bfb40 100644 --- a/src/detect-filename.c +++ b/src/detect-filename.c @@ -156,7 +156,7 @@ static int DetectFilenameMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, } } - if (ret == 0 && (filename->flags & DETECT_CONTENT_NEGATED)) { + else if (filename->flags & DETECT_CONTENT_NEGATED) { SCLogDebug("negated match"); ret = 1; }