make strtok_r private

Fixes #189

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel
2022-02-01 13:30:34 +01:00
parent 93e04b8d03
commit 728e050a05
4 changed files with 8 additions and 8 deletions

View File

@@ -883,13 +883,13 @@ xmpp_stanza_t *xmpp_stanza_get_child_by_path(xmpp_stanza_t *stanza, ...)
break;
}
saveattr = ns = NULL;
attr = xmpp_strtok_r(tok, "[", &saveattr);
attr = strophe_strtok_r(tok, "[", &saveattr);
if (attr) {
attr = xmpp_strtok_r(NULL, "]", &saveattr);
attr = strophe_strtok_r(NULL, "]", &saveattr);
if (attr) {
if (!strncmp(attr, "@ns='", 5)) {
ns = attr + 5;
xmpp_strtok_r(ns, "'", &saveattr);
strophe_strtok_r(ns, "'", &saveattr);
}
}
}

View File

@@ -80,7 +80,7 @@ char *strophe_strndup(const xmpp_ctx_t *ctx, const char *s, size_t len)
* For example, visual studio older than 2005 doesn't provide strtok_r()
* nor strtok_s().
*/
char *xmpp_strtok_r(char *s, const char *delim, char **saveptr)
char *strophe_strtok_r(char *s, const char *delim, char **saveptr)
{
size_t len;

View File

@@ -26,7 +26,7 @@
#define xmpp_min(x, y) ((x) < (y) ? (x) : (y))
/* string functions */
char *xmpp_strtok_r(char *s, const char *delim, char **saveptr);
char *strophe_strtok_r(char *s, const char *delim, char **saveptr);
/* timing functions */
uint64_t time_stamp(void);