summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rtclient.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rtclient.c b/rtclient.c
index f4abc90..454b53c 100644
--- a/rtclient.c
+++ b/rtclient.c
@@ -45,9 +45,9 @@ user_callback(void *contents, size_t size, size_t nmemb, void *writedata)
char *line = strtok_r(response, "\n", &linesaveptr);
if (strstr(line, "200 Ok")) {
line = strtok_r(NULL, "\n", &linesaveptr);
+ char *tokensaveptr = NULL, *token = NULL;
do {
- char *tokensaveptr = NULL;
- char *token = strtok_r(line, ":", &tokensaveptr);
+ token = strtok_r(line, ":", &tokensaveptr);
if (!strcmp(token, "id")) {
token = strtok_r(NULL, ":", &tokensaveptr);
user->id = malloc(strlen(token));