From 3d603bdd66643ce1d9b530978644c7aa747145fd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 20 Aug 2006 21:57:08 +0000 Subject: r17633: Return NULL at the end of the file, or else we can't tell the difference between end of file and a blank line. Andrew Bartlett (This used to be commit 6fd6239a0f16154c13713bf1398b2873d1103335) --- source4/lib/util/util_file.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/util/util_file.c b/source4/lib/util/util_file.c index 99432ad8bb..3451712053 100644 --- a/source4/lib/util/util_file.c +++ b/source4/lib/util/util_file.c @@ -125,6 +125,10 @@ _PUBLIC_ char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint) ret = read(fd, data + offset, hint); + if (ret == 0) { + return NULL; + } + if (ret == -1) { talloc_free(data); return NULL; -- cgit