gd_strtok: constify delimiter
parent
5c55da917d
commit
968ba1132d
|
@ -15,13 +15,13 @@
|
||||||
#define SEP_TEST (separators[*((unsigned char *) s)])
|
#define SEP_TEST (separators[*((unsigned char *) s)])
|
||||||
|
|
||||||
char *
|
char *
|
||||||
gd_strtok_r (char *s, char *sep, char **state)
|
gd_strtok_r(char *s, const char *sep, char **state)
|
||||||
{
|
{
|
||||||
char separators[256];
|
char separators[256];
|
||||||
char *result = 0;
|
char *result = 0;
|
||||||
memset (separators, 0, sizeof (separators));
|
memset (separators, 0, sizeof (separators));
|
||||||
while (*sep) {
|
while (*sep) {
|
||||||
separators[*((unsigned char *) sep)] = 1;
|
separators[*((const unsigned char *) sep)] = 1;
|
||||||
sep++;
|
sep++;
|
||||||
}
|
}
|
||||||
if (!s) {
|
if (!s) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ extern "C" {
|
||||||
|
|
||||||
/* TBB: strtok_r is not universal; provide an implementation of it. */
|
/* TBB: strtok_r is not universal; provide an implementation of it. */
|
||||||
|
|
||||||
char * gd_strtok_r (char *s, char *sep, char **state);
|
char *gd_strtok_r(char *s, const char *sep, char **state);
|
||||||
|
|
||||||
/* These functions wrap memory management. gdFree is
|
/* These functions wrap memory management. gdFree is
|
||||||
in gd.h, where callers can utilize it to correctly
|
in gd.h, where callers can utilize it to correctly
|
||||||
|
|
Loading…
Reference in New Issue