#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
+#include "os_regex.h"
#include "os_regex_internal.h"
* 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 *));