src/config.c
changeset 33 56571d34d754
parent 18 4435146391ae
child 36 6889aacd038e
--- a/src/config.c
+++ b/src/config.c
@@ -10,6 +10,7 @@
 
 #include <compat.h>
 #include <config.h>
+#include "common.h"
 
 const
 char *CONFIG_OPTIONS[] = {
@@ -20,7 +21,7 @@
 int config (UC * uc, char *fname)
 {
     FILE *f;
-    char buffer[513];
+    char buffer[DEFAULT_BUF_SIZE];
     char **line;
     char *token;
     char *value;
@@ -41,8 +42,7 @@
     uc->port = 6667;
 
     while (!feof (f)) {
-        *buffer = '\0';
-        (void)fgets (buffer, 512, f);
+        (void)fgets (buffer, sizeof (buffer), f);
         token = buffer;
 
         while (*token == '\t')  /* Eat trailing tabs */