summaryrefslogtreecommitdiff
path: root/source4/lib/util
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-20 21:57:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:17 -0500
commit3d603bdd66643ce1d9b530978644c7aa747145fd (patch)
treebad253643937b73fb88d91d6b63a4c49bd399b38 /source4/lib/util
parentff5120ea1fdce667684c341154631e29b5f51849 (diff)
downloadsamba-3d603bdd66643ce1d9b530978644c7aa747145fd.tar.gz
samba-3d603bdd66643ce1d9b530978644c7aa747145fd.tar.bz2
samba-3d603bdd66643ce1d9b530978644c7aa747145fd.zip
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)
Diffstat (limited to 'source4/lib/util')
-rw-r--r--source4/lib/util/util_file.c4
1 files changed, 4 insertions, 0 deletions
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;