A simple .ini file interface.
Dependents: Smart-WiFly-WebServer SignalGenerator WattEye X10Svr
Diff: IniManager.cpp
- Revision:
- 17:01c0ee144433
- Parent:
- 16:82e0f8747b95
- Child:
- 18:282ed56d983b
--- a/IniManager.cpp Thu Apr 14 03:12:22 2016 +0000 +++ b/IniManager.cpp Thu May 19 18:10:46 2016 +0000 @@ -239,7 +239,7 @@ if (valBuf != NULL && strcmp(eq, valBuf) != 0) { // replace the old record if (valBuf != NULL) { - fprintf(fo, "%s=%s\n", key, valBuf); + fprintf(fo, "%s=%s\r\n", key, valBuf); printf("write: %s=%s\r\n", key, valBuf); INFO(" write: %s=%s", key, valBuf); } @@ -249,7 +249,7 @@ found = true; } else { // write old record - fprintf(fo, "%s=%s\n", buf, eq); + fprintf(fo, "%s=%s\r\n", buf, eq); INFO(" write: %s=%s", buf, eq); } } else { @@ -295,7 +295,7 @@ // No old file, just create it now if (valBuf != NULL) { if (!inSection) { - fprintf(fo, "[%s]\r\n", section); + fprintf(fo, "\r\n[%s]\r\n", section); INFO(" write: [%s]", section); } fprintf(fo, "%s=%s\r\n", key, valBuf);