FILE *fsys; char *bufString; char *mounted = malloc(14*sizeof(char)); char bufsys; unsigned short size_line = 1, Fsize_line = 0, num_line = 1; unsigned short i = 0, j = 0; fpos_t *orPos = malloc(sizeof(fpos_t)); show_msg("Parsing the file system configuration (\\sidetext\\fsys)....."); //First we look for the file system config file sprintf(mounted, "%s\\fsys", mounted_rep); //mounted_rep is a global char* fsys = fopen(mounted, "r"); if(!fsys) return error(ERR_FILE); if(fgetpos(fsys, orPos)) return error(ERR_FILE); //Scan the file to have the malloc values do { bufsys = fgetc(fsys); if(bufsys != ':' && bufsys != CR) { //CR = '\r' (#define) size_line++; } else if(bufsys == CR) { num_line++; } else { if(size_line > Fsize_line) Fsize_line = size_line; size_line = 0; } }while(bufsys != EOF); Fsize_line++; //Let's malloc our big stuff bufString = malloc(Fsize_line*sizeof(char)); FileSystem1 = malloc(num_line); //it's global variable: char ** FileSystem2 = malloc(num_line); // the same here char ** for(i=0;i