Per issue 13, return error status from handler() in example.
diff --git a/examples/ini_example.c b/examples/ini_example.c
index 6624750..c5fb131 100644
--- a/examples/ini_example.c
+++ b/examples/ini_example.c
@@ -1,6 +1,7 @@
/* Example: parse a simple configuration file */
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "../ini.h"
@@ -23,7 +24,10 @@
pconfig->name = strdup(value);
} else if (MATCH("user", "email")) {
pconfig->email = strdup(value);
+ } else {
+ return 0; /* unknown section/name, error */
}
+ return 1;
}
int main(int argc, char* argv[])