#include #include #include #include "install-zip.h" #include "gecko.h" //these are in main.h void create_folders(char path[]); void download_file(char file[], char savefile[], int status); void install_mod(char file[], int row) { FILE *fp = fopen(file, "r"); if (!fp) { printf("Could not open %s\n", file); gprintf("Could not open %s", file); exit(1); } fseek(fp, 0L, SEEK_END);//seek to the end of the file int size = ftell(fp);//store lenght of file rewind(fp);//seek back to start of file char buff[size+1];//a little excessive perhaps, but such size is required if the file only contains 1 line buff[size] = '\0';//add null char to end of buff char *colon;//location of colon int count = 0; char *result; while(1) { result = fgets(buff, size, fp);//copy a line from fp into buff if (!result) { printf("%s malformed0\n", file); gprintf("%s malformed0", file); exit(1); } if (count == row) { //replace a found newline with a null char. Also, stop if a null char is found for (int i = 0; i