--- Daodan/src/inifile_reader.c 2009/07/26 12:04:44 451 +++ Daodan/src/inifile_reader.c 2013/03/02 23:46:33 677 @@ -1,6 +1,6 @@ #include #include -#include +#include "bool.h" #include #include @@ -10,11 +10,10 @@ char* inifile_cleanstr(char* str) { int i; for (i = strlen(str) - 1; i >= 0; i --) - if (!isspace(str[i])) - { - str[i + 1] = '\0'; + if (isspace(str[i])) + str[i] = '\0'; + else break; - } while (isspace(*str)) str++; @@ -113,7 +112,7 @@ bool inifile_read(const char* filename, if (inisection[0]) free(inisection); - inisection = strdup(readptr + 1); // Skip the first [ + inisection = _strdup(readptr + 1); // Skip the first [ newsection = true; } else // It's a value.