diff options
author | Antti-Juhani Kaijanaho <ajk@debian.org> | 2006-01-28 21:48:13 +0100 |
---|---|---|
committer | Antti-Juhani Kaijanaho <ajk@debian.org> | 2006-01-28 21:48:13 +0100 |
commit | 16747fcf09555f47c9d6d49e3379f1bdc2e85e7c (patch) | |
tree | f84621f79e982219ba91f26da2ae7790a912cc37 /getaline.c | |
parent | 51f1cad5c1604a78d74a5da904329d1919997027 (diff) | |
download | dctrl-tools-16747fcf09555f47c9d6d49e3379f1bdc2e85e7c.tar.gz |
Import 2.1.5
Diffstat (limited to 'getaline.c')
-rw-r--r-- | getaline.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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') |