Skip to content

Commit

Permalink
Moved around cleanup code, minor fixes, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
farfalleflickan committed Sep 24, 2024
1 parent a3b57f7 commit 87445fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down
8 changes: 1 addition & 7 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -811,18 +811,18 @@ 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);
printError("", true, COLOR_RESET, tempStr);
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;
}
Expand Down

0 comments on commit 87445fd

Please sign in to comment.