Make tokenize work with a const char pointer.
This commit is contained in:
+1
-1
@@ -177,7 +177,7 @@ char *strtok_r(char *str, const char *delim, char **saveptr);
|
||||
/// @param buffer the buffer where we save the parsed token.
|
||||
/// @param buflen the length of the buffer.
|
||||
/// @return 1 if we still have things to parse, 0 if we finished parsing.
|
||||
int tokenize(char *string, char *separators, size_t *offset, char *buffer, ssize_t buflen);
|
||||
int tokenize(const char *string, char *separators, size_t *offset, char *buffer, ssize_t buflen);
|
||||
|
||||
/// @brief Copies the values of num bytes from the location pointed by source
|
||||
/// to the memory block pointed by destination.
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ char *strpbrk(const char *string, const char *control)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int tokenize(char *string, char *separators, size_t *offset, char *buffer, ssize_t buflen)
|
||||
int tokenize(const char *string, char *separators, size_t *offset, char *buffer, ssize_t buflen)
|
||||
{
|
||||
// If we reached the end of the parsed string, stop.
|
||||
if (string[*offset] == 0) {
|
||||
|
||||
@@ -218,7 +218,7 @@ char *strpbrk(const char *string, const char *control)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int tokenize(char *string, char *separators, size_t *offset, char *buffer, ssize_t buflen)
|
||||
int tokenize(const char *string, char *separators, size_t *offset, char *buffer, ssize_t buflen)
|
||||
{
|
||||
// If we reached the end of the parsed string, stop.
|
||||
if (string[*offset] == 0) {
|
||||
|
||||
Reference in New Issue
Block a user