diff options
author | rafa_99 <raroma09@gmail.com> | 2021-09-18 00:37:33 +0100 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2021-09-18 00:37:33 +0100 |
commit | cbf64d0333234b22d3fa4a0a2cc00dcb82675019 (patch) | |
tree | ac4030cc4fc09eff0e4f1cfdab10d5b974255d29 | |
parent | ae7a4d4229d640b97c501ed35dadf43713282ba1 (diff) |
Code Cleanup
-rw-r--r-- | libs/curl.c | 1 | ||||
-rw-r--r-- | libs/json.c | 2 | ||||
-rw-r--r-- | libs/string.c | 1 | ||||
-rw-r--r-- | src/utils.c | 9 |
4 files changed, 4 insertions, 9 deletions
diff --git a/libs/curl.c b/libs/curl.c index 03509d9..73ecdc3 100644 --- a/libs/curl.c +++ b/libs/curl.c @@ -2,7 +2,6 @@ #include "string.h" #include <curl/curl.h> #include <curl/easy.h> -#include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/libs/json.c b/libs/json.c index 03d8aab..2756e1a 100644 --- a/libs/json.c +++ b/libs/json.c @@ -1,8 +1,6 @@ #include "json.h" #include "../include/video.h" #include <json-c/json.h> -#include <stdio.h> -#include <stdlib.h> #include <string.h> json_object * diff --git a/libs/string.c b/libs/string.c index 8c2eab2..1e65ac1 100644 --- a/libs/string.c +++ b/libs/string.c @@ -1,5 +1,4 @@ #include "string.h" -#include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/src/utils.c b/src/utils.c index f004aa4..7c3cb7c 100644 --- a/src/utils.c +++ b/src/utils.c @@ -3,7 +3,6 @@ #include "../libs/curl.h" #include "../libs/string.h" #include <ctype.h> -#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -87,11 +86,11 @@ extractQueryJSON (char *youtubeurl) char *htmlPage = downloadPage (youtubeurl); if (htmlPage != NULL && strlen (htmlPage) > 0) { - char *jsonVar = strstr(htmlPage, JSONVAR) + strlen(JSONVAR); - if ( jsonVar != NULL && strlen(jsonVar) > 0 ) + char *jsonVar = strstr (htmlPage, JSONVAR) + strlen (JSONVAR); + if (jsonVar != NULL && strlen (jsonVar) > 0) { - json = (char *) calloc(strlen(jsonVar) + 1, sizeof(char)); - strcpy(json, jsonVar); + json = (char *)calloc (strlen (jsonVar) + 1, sizeof (char)); + strcpy (json, jsonVar); } } free (htmlPage); |