summaryrefslogtreecommitdiff
path: root/examples/io.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2012-09-10 21:54:24 +0200
committerNiels Möller <nisse@lysator.liu.se>2012-09-10 21:54:24 +0200
commit2bd9d1b8703e57eeb955c16f482555abe6315a4d (patch)
treeb242c5a5e7411efa0b7e049b0baab70ff24ae5f3 /examples/io.h
parent3ead2b978cb8bff337f3ae659d315da483525ab7 (diff)
downloadnettle-2bd9d1b8703e57eeb955c16f482555abe6315a4d.tar.gz
Reorganized read_file loop.
Diffstat (limited to 'examples/io.h')
-rw-r--r--examples/io.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/io.h b/examples/io.h
index d95c81a3..f79855da 100644
--- a/examples/io.h
+++ b/examples/io.h
@@ -39,8 +39,11 @@ xalloc(size_t size);
void
werror(const char *format, ...) PRINTF_STYLE(1, 2);
-/* If size is > 0, read at most that many bytes. If size == 0,
- * read until EOF. Allocates the buffer dynamically. */
+/* If size is > 0, read at most that many bytes. If size == 0, read
+ * until EOF. Allocates the buffer dynamically. An empty file is
+ * treated as an error; return value is zero, and no space is
+ * allocated. The returned data is NUL-terminated, for convenience. */
+
unsigned
read_file(const char *name, unsigned size, char **buffer);