projects
/
NeonServV5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed "may be uninitialized" on linux systems
[NeonServV5.git]
/
src
/
lib
/
ini.c
diff --git
a/src/lib/ini.c
b/src/lib/ini.c
index e0bd1af8281dd26a295120750df32586ab2138c2..b9e8f97ef99b11c624e5dd9d7a80b1c0f493e6bc 100644
(file)
--- a/
src/lib/ini.c
+++ b/
src/lib/ini.c
@@
-124,7
+124,7
@@
void ReadString(char *SectionName,char *FieldName,char *FieldValue) {
int loadINI(char *filename) {
FILE *f;
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");
char SectionName[SECTION_LEN], FieldName[FIELDNAME_LEN], FieldValue[FIELDVALUE_LEN], ch;
f=fopen(filename,"rb");
@@
-150,10
+150,9
@@
int loadINI(char *filename) {
removeSpace(SectionName);
while(!feof(f)) {
fread(&ch,sizeof(char),1,f);
removeSpace(SectionName);
while(!feof(f)) {
fread(&ch,sizeof(char),1,f);
- if (ch ==
0x0d
)
+ if (ch ==
'\r' || ch == '\n'
)
break;
}
break;
}
- fread(&ch,sizeof(char),1,f);
if (SectionName[0] == '\0')
continue;
while(!feof(f)) {
if (SectionName[0] == '\0')
continue;
while(!feof(f)) {
@@
-195,7
+194,6
@@
int loadINI(char *filename) {
}
}
removeSpace(FieldValue);
}
}
removeSpace(FieldValue);
- fread(&ch,sizeof(char),1,f);
WriteString(SectionName,FieldName,FieldValue);
}
}
WriteString(SectionName,FieldName,FieldValue);
}
}