Make tokenize work with a const char pointer.

This commit is contained in:
Enrico Fraccaroli (Galfurian)
2023-08-30 15:38:52 -04:00
parent ecf5907f83
commit 163e83009d
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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) {
+1 -1
View File
@@ -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) {