diff options
-rw-r--r-- | src/sttorrent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sttorrent.c b/src/sttorrent.c index a911071..72dd2e4 100644 --- a/src/sttorrent.c +++ b/src/sttorrent.c @@ -96,7 +96,7 @@ main(void) char id[75]; CURL* handle; CURLcode res; - cJSON *torrents; + cJSON *root, *arguments, *status,*torrents; int status_count[7] = {0}; struct MemoryStruct chunk; struct curl_slist *headers = NULL; @@ -129,7 +129,7 @@ main(void) if (res != CURLE_OK) { return 1; } /* JSON parsing */ - torrents = cJSON_Parse(chunk.memory); + root = cJSON_Parse(chunk.memory); /* Cleanup */ curl_easy_cleanup(handle); @@ -137,11 +137,11 @@ main(void) free(chunk.memory); curl_global_cleanup(); - torrents = cJSON_GetObjectItem(torrents, "arguments"); - torrents = cJSON_GetObjectItem(torrents, "torrents"); + arguments = cJSON_GetObjectItem(root, "arguments"); + torrents = cJSON_GetObjectItem(arguments, "torrents"); if (cJSON_GetArraySize(torrents) == 0) { - cJSON_Delete(torrents); + cJSON_Delete(root); return 0; } @@ -168,6 +168,6 @@ main(void) printf("%d", status_count[i]); } - cJSON_Delete(torrents); + cJSON_Delete(root); return 0; } |