X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=src%2Fos_regex%2Fos_match.c;h=35ca37030017233b80417b3e43c31549a2dc708d;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=cd4013653143b8e1d95cf12f34d2131238398b06;hpb=301048b51990573e58a30dc4a5bb4ec285cad554;p=ossec-hids.git diff --git a/src/os_regex/os_match.c b/src/os_regex/os_match.c old mode 100755 new mode 100644 index cd40136..35ca370 --- a/src/os_regex/os_match.c +++ b/src/os_regex/os_match.c @@ -1,5 +1,3 @@ -/* $OSSEC, os_regex.c, v0.4, 2006/01/02, Daniel B. Cid$ */ - /* Copyright (C) 2009 Trend Micro Inc. * All right reserved. * @@ -9,7 +7,6 @@ * Foundation */ - #include #include #include @@ -17,31 +14,25 @@ #include "os_regex.h" -/** int OS_Match2(char *pattern, char *str) v0.4 - * - * This function is a wrapper around the compile/execute +/* This function is a wrapper around the compile/execute * functions. It should only be used when the pattern is * only going to be used once. * Returns 1 on success or 0 on failure. */ -int OS_Match2(char *pattern, char *str) +int OS_Match2(const char *pattern, const char *str) { int r_code = 0; OSMatch reg; /* If the compilation failed, we don't need to free anything */ - if(OSMatch_Compile(pattern, ®, 0)) - { - if(OSMatch_Execute(str,strlen(str), ®)) - { + if (OSMatch_Compile(pattern, ®, 0)) { + if (OSMatch_Execute(str, strlen(str), ®)) { r_code = 1; } OSMatch_FreePattern(®); } - - return(r_code); -} + return (r_code); +} -/* EOF */