X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_regex%2Fos_regex_strbreak.c;fp=src%2Fos_regex%2Fos_regex_strbreak.c;h=d04f3555a14f5e8a2eda20f09cbb21bb8559f5a3;hp=e6905c01b250f1e6a8a0d3e9b9327f223ce5bf8f;hb=789cbc8e52da68eba3517b920ef22e000cf3c9fd;hpb=ef70704f0b31b59bb719b884d6a99cb9e3e2044a diff --git a/src/os_regex/os_regex_strbreak.c b/src/os_regex/os_regex_strbreak.c index e6905c0..d04f355 100755 --- a/src/os_regex/os_regex_strbreak.c +++ b/src/os_regex/os_regex_strbreak.c @@ -13,6 +13,8 @@ #include #include #include + +#include "os_regex.h" #include "os_regex_internal.h" @@ -20,17 +22,17 @@ * Split a string into multiples pieces, divided by a char "match". * Returns a NULL terminated array on success or NULL on error. */ -char **OS_StrBreak(char match, char *str, int size) +char **OS_StrBreak(char match, const char *str, size_t size) { - int count = 0; - int i = 0; + size_t count = 0; + size_t i = 0; - char *tmp_str = str; + const char *tmp_str = str; char **ret; - /* We can't do anything if str is null or size <= 0 */ - if((str == NULL)||(size <= 0)) + /* We can't do anything if str is null */ + if(str == NULL) return(NULL); ret = (char **)calloc(size+1, sizeof(char *));