Changeset 349 for Daodan/src/inifile_reader.c
- Timestamp:
- Jun 10, 2009, 2:40:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/inifile_reader.c
r346 r349 6 6 7 7 #include "inifile.h" 8 8 /* 9 char* inifile_cleanstr(char* str) 10 { 11 while (isspace(*str)) 12 str++; 13 14 int i; 15 for (i = 0; str[i]; i ++) 16 { 17 if 18 } 19 20 return str; 21 } 22 */ 9 23 bool inifile_read(char* filename, inifile_callback callback) 10 24 { … … 43 57 if (inisection[0]) 44 58 free(inisection); 45 inisection = strdup(readptr + 1); 59 inisection = strdup(readptr + 1); // Skip the first [ 46 60 newsection = true; 47 61 } … … 57 71 readptr[i - 1] = '\0'; // Remove the trailing newline. 58 72 59 if (equals) // If there's no equals, crash with error.73 if (equals) 60 74 { 61 75 readptr[equals] = '\0'; … … 64 78 newsection = false; 65 79 } 66 else 80 else // If there's no equals, crash with error. 67 81 { 68 82 success = false;
Note:
See TracChangeset
for help on using the changeset viewer.