diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-13 11:17:26 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-13 11:17:26 +0800 |
commit | 7fbf4dc6b00a389dd87d32bbf18147fbb3af7b3f (patch) | |
tree | 5814f0f6098d6639f8ad4bfc58e7c2807ce73c6e | |
parent | c7ec01708af00c4edfe0fdf447ac6a19b741a91b (diff) |
Take out the subtoken variable declarations out from the loop
-rw-r--r-- | rtclient.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)); |