Fix reading configuration files that do not end with a newline. Again.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 17 Apr 2010 10:01:38 +0000 (12:01 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 17 Apr 2010 10:01:38 +0000 (12:01 +0200)
NEWS
configure.in
src/conf.c

diff --git a/NEWS b/NEWS
index a753f1c..b5ce496 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Version 1.0.14               not released yet
+
+ * Fixed reading configuration files that do not end with a newline. Again.
+
 Version 1.0.13               Apr 11 2010
 
  * Allow building tinc without LZO and/or Zlib.
 Version 1.0.13               Apr 11 2010
 
  * Allow building tinc without LZO and/or Zlib.
index 9a2b88d..8e1ae87 100644 (file)
@@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.61)
 AC_INIT
 AC_CONFIG_SRCDIR([src/tincd.c])
 AC_PREREQ(2.61)
 AC_INIT
 AC_CONFIG_SRCDIR([src/tincd.c])
-AM_INIT_AUTOMAKE(tinc, 1.0.13)
+AM_INIT_AUTOMAKE(tinc, 1.0.13+git)
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE
 
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE
 
index f64fb22..ea33e9c 100644 (file)
@@ -224,7 +224,7 @@ static char *readline(FILE * fp, char *buf, size_t buflen) {
        newline = strchr(p, '\n');
 
        if(!newline)
        newline = strchr(p, '\n');
 
        if(!newline)
-               return NULL;
+               return buf;
 
        *newline = '\0';        /* kill newline */
        if(newline > p && newline[-1] == '\r')  /* and carriage return if necessary */
 
        *newline = '\0';        /* kill newline */
        if(newline > p && newline[-1] == '\r')  /* and carriage return if necessary */