diff --git a/src/conf.c b/src/conf.c index 3192208..a3ab07c 100644 --- a/src/conf.c +++ b/src/conf.c @@ -287,7 +287,7 @@ progConfig *getConfig(char *srcPath) { if (setrlimit(RLIMIT_NOFILE, &(options->newLim))==-1){ confCleanup(options); - fatalError_abort("getConfig error", "could not set new fileLimit, error: %s\n", errno, strerror(errno)); + fatalError_abort("getConfig error", "could not set new fileLimit, error: %s\n", strerror(errno)); } } } diff --git a/src/main.c b/src/main.c index 50d4ba2..f621ac7 100644 --- a/src/main.c +++ b/src/main.c @@ -17,7 +17,7 @@ #include "main.h" #define REPO_URL "https://github.com/farfalleflickan/cmyflix" -#define VERSION_STRING "0.22" +#define VERSION_STRING "0.23" // GLOBAL VARIABLES FILE *LOGFILE=NULL; @@ -78,9 +78,6 @@ void checkUpdate() { resetSTDColors(); FILE *cmdRet=popen(cmdStr, "r"); if (cmdRet==NULL) { - if (pclose(cmdRet)!=0) { - printError("cmyflix", false, HRED, "%s\n", strerror(errno)); - } tryFree(cmdStr); fatalError_exit("checkUpdate", "something went wrong while trying to check for an update, errno is: %s\n", strerror(errno)); } else { @@ -215,9 +212,6 @@ void copyExtras(progConfig *conf, progFlags runFlags, char *htmlFolder, char *de resetSTDColors(); FILE *cmdRet=popen(cmdStr, "r"); if (cmdRet==NULL) { - if (pclose(cmdRet)!=0) { - printError("cmyflix", false, HRED, "%s\n", strerror(errno)); - } tryFree(cmdStr); fatalError_exit("cmyflix error", "something went wrong while trying to copy HTML resources from '%s' to '%s';\n", extPath, tempStr2); } else { diff --git a/src/utils.c b/src/utils.c index 6503771..42609df 100644 --- a/src/utils.c +++ b/src/utils.c @@ -791,10 +791,10 @@ char *getPoster(const char *posterURL, progConfig *conf, int prefImgWidth, doubl } cJSON_Delete(imgStr); } - cJSON_Delete(width); - cJSON_Delete(ratio); - cJSON_Delete(lang); } + cJSON_Delete(width); + cJSON_Delete(ratio); + cJSON_Delete(lang); } else { printError("getPoster warning", true, HYEL, "request error, URL: '%s';\nitem==NULL - json_posters was:\n", posterURL); char *tempStr=cJSON_Print(json_posters); @@ -811,7 +811,6 @@ char *getPoster(const char *posterURL, progConfig *conf, int prefImgWidth, doubl printError("", true, HYEL, "\nEND;\n"); tryFree(tempStr); } - cJSON_Delete(json_posters); } else { printError("getPoster warning", true, HYEL, "request error, URL: '%s';\njson_posters==NULL - json_root was:\n", posterURL); char *tempStr=cJSON_Print(json_root); @@ -819,10 +818,11 @@ char *getPoster(const char *posterURL, progConfig *conf, int prefImgWidth, doubl printError("", true, HYEL, "\nEND;\n"); tryFree(tempStr); } - cJSON_Delete(json_root); + cJSON_Delete(json_posters); } else { printError("getPoster warning", true, HYEL, "request error, URL: '%s';\njson_root==NULL\n", posterURL); } + cJSON_Delete(json_root); freeBlock(mem); return imgURL; }