summaryrefslogtreecommitdiff
path: root/modules/read-file
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivano@gnu.org>2010-08-28 16:12:37 +0200
committerBruno Haible <bruno@clisp.org>2010-08-28 16:14:23 +0200
commit3e53db21df4287b43a46ad27fc2fac56b9194ffc (patch)
treea90e5450e0d7ce28a25f15970100e42784f4c385 /modules/read-file
parent5712b089a6b769e76e21cc3b5601a9e787f82092 (diff)
downloadgnulib-3e53db21df4287b43a46ad27fc2fac56b9194ffc.tar.gz
read-file: Avoid memory reallocations with regular files.
* lib/read-file.c: Include <sys/stat.h>, <stdio.h>, <stdint.h>. (fread_file): With regular files, use the remaining length as the initial buffer size. Check against overflow. * modules/read-file (Depends-on): Add ftello, malloc-posix, stdint, sys_stat.
Diffstat (limited to 'modules/read-file')
-rw-r--r--modules/read-file4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/read-file b/modules/read-file
index e302940010..6ad941b270 100644
--- a/modules/read-file
+++ b/modules/read-file
@@ -7,7 +7,11 @@ lib/read-file.c
m4/read-file.m4
Depends-on:
+ftello
+malloc-posix
realloc-posix
+stdint
+sys_stat
configure.ac:
gl_FUNC_READ_FILE