int loadINI(char *filename) {
FILE *f;
- int i, fpointer;
+ int i, fpointer = 0;
char SectionName[SECTION_LEN], FieldName[FIELDNAME_LEN], FieldValue[FIELDVALUE_LEN], ch;
f=fopen(filename,"rb");
removeSpace(SectionName);
while(!feof(f)) {
fread(&ch,sizeof(char),1,f);
- if (ch == 0x0d)
+ if (ch == '\r' || ch == '\n')
break;
}
- fread(&ch,sizeof(char),1,f);
if (SectionName[0] == '\0')
continue;
while(!feof(f)) {
}
}
removeSpace(FieldValue);
- fread(&ch,sizeof(char),1,f);
WriteString(SectionName,FieldName,FieldValue);
}
}