Ben Faucher / ConfigFile

Fork of ConfigFile by Shinichiro Nakamura

Files at this revision

API Documentation at this revision

Comitter:
faucherb94
Date:
Wed Dec 10 20:24:28 2014 +0000
Parent:
6:f6ceafabe9f8
Child:
8:8b282b2b8d24
Commit message:
Extended max key length to 500 characters

Changed in this revision

ConfigFile.cpp Show annotated file Show diff for this revision Revisions of this file
ConfigFile.h Show annotated file Show diff for this revision Revisions of this file
--- a/ConfigFile.cpp	Wed Sep 15 13:49:15 2010 +0000
+++ b/ConfigFile.cpp	Wed Dec 10 20:24:28 2014 +0000
@@ -300,11 +300,14 @@
      * Read from a file.
      */
     char buf[MAXLEN_KEY + 8 + MAXLEN_VALUE];
+    //printf("CFG: Reading in lines...\r\n");
     while (fgets(buf, sizeof(buf), fp) != NULL) {
+        //printf("CFG: Line: %s", buf);
         /*
          * Ignore a comment.
          */
         if (buf[0] == '#') {
+            //printf("CFG: Comment\r\n");
             continue;
         }
 
@@ -326,8 +329,10 @@
         char *sp = strchr(buf, SEPARATOR);
         if (sp != NULL) {
             strcpy(v, sp + 1);
+            //printf("CFG: Value: %s\r\n", v);
             *sp = '\0';
             strcpy(k, buf);
+            //printf("CFG: Key: %s\r\n", k);
             setValue(k, v);
         }
     }
--- a/ConfigFile.h	Wed Sep 15 13:49:15 2010 +0000
+++ b/ConfigFile.h	Wed Dec 10 20:24:28 2014 +0000
@@ -111,7 +111,7 @@
     config_t **configlist;
     static const int MAXCONFIG = 64;
     static const int MAXLEN_KEY = 64;
-    static const int MAXLEN_VALUE = 128;
+    static const int MAXLEN_VALUE = 500;
     static const char SEPARATOR = '=';
 
     config_t *search(char *key);