A simple .ini file interface.

Dependents:   Smart-WiFly-WebServer SignalGenerator WattEye X10Svr

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sun Nov 11 22:56:13 2018 +0000
Parent:
24:ba5fa9548f59
Child:
26:e8d7b09a77a3
Child:
27:611ffb74fd38
Commit message:
Correct a defect - if a section was null, but existed "[]", it would be parsed as a null, which causes it to start searching again from the beginning. Now it will exit as done.

Changed in this revision

IniManager.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/IniManager.cpp	Wed Apr 11 00:28:03 2018 +0000
+++ b/IniManager.cpp	Sun Nov 11 22:56:13 2018 +0000
@@ -84,7 +84,8 @@
                 if (pRBrkt) {
                     *pRBrkt = '\0';
                     if (returnNext) {
-                        if (strlen(pStart) < bufferSize) {
+                        // Guard against "[]" which would cause it to recycle from the start
+                        if (strlen(pStart) > 0 && strlen(pStart) < bufferSize) {
                             strcpy(buffer, pStart);
                             found = true;
                             break;