Allow longer lines in config file
authorMikael Berthe <mikael@lilotux.net>
Sat, 25 Aug 2007 11:06:28 +0200
changeset 1278 c3107650d165
parent 1277 b6d333044269
child 1279 8bbc764139ef
Allow longer lines in config file The maximum line length in the conf. file should be the same as in the UI. Reported by "ManMachine".
mcabber/src/settings.c
--- a/mcabber/src/settings.c	Fri Aug 24 07:06:10 2007 +0200
+++ b/mcabber/src/settings.c	Sat Aug 25 11:06:28 2007 +0200
@@ -28,6 +28,10 @@
 #include "utils.h"
 #include "logprint.h"
 
+// Maximum line length 
+// (probably best to use the same value as INPUTLINE_LENGTH)
+#define CONFLINE_LENGTH  1024
+
 static GHashTable *option;
 static GHashTable *alias;
 static GHashTable *binding;
@@ -128,9 +132,9 @@
     scr_LogPrint(LPRINT_LOGNORM, "Reading %s", filename);
   }
 
-  buf = g_new(char, 512);
+  buf = g_new(char, CONFLINE_LENGTH+1);
 
-  while (fgets(buf+1, 511, fp) != NULL) {
+  while (fgets(buf+1, CONFLINE_LENGTH, fp) != NULL) {
     // The first char is reserved to add a '/', to make a command line
     line = buf+1;
     ln++;