summaryrefslogtreecommitdiff
path: root/getaline.c
diff options
context:
space:
mode:
authorAntti-Juhani Kaijanaho <ajk@debian.org>2006-01-28 21:48:13 +0100
committerAntti-Juhani Kaijanaho <ajk@debian.org>2006-01-28 21:48:13 +0100
commit16747fcf09555f47c9d6d49e3379f1bdc2e85e7c (patch)
treef84621f79e982219ba91f26da2ae7790a912cc37 /getaline.c
parent51f1cad5c1604a78d74a5da904329d1919997027 (diff)
downloaddctrl-tools-16747fcf09555f47c9d6d49e3379f1bdc2e85e7c.tar.gz
Import 2.1.5
Diffstat (limited to 'getaline.c')
-rw-r--r--getaline.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/getaline.c b/getaline.c
index 4d75087..8b6ce24 100644
--- a/getaline.c
+++ b/getaline.c
@@ -66,6 +66,8 @@ char * getaline (FILE * f)
buf = malloc (size);
if (buf == NULL) return NULL;
+ buf[0] = '\0';
+
while (fgets (buf + len, size - len, f) != NULL) {
len += strlen(buf + len);
if (len > 0 && buf[len - 1] == '\n')