aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2024-02-28 16:56:24 +0000
committerAlexander Færøy <ahf@torproject.org>2024-02-28 16:56:24 +0000
commita5d53ce4164bd8a2070435dd7887bdfd0b5480dd (patch)
tree1977f5974340b32695b32829f4b7b6effe7dcc29
parent72ac1de514fb3f7ee9fc301cd20498c92c29a360 (diff)
parente913de1bc651bbe5171760ffbe6926a43650f5d0 (diff)
downloadtor-a5d53ce4164bd8a2070435dd7887bdfd0b5480dd.tar.gz
tor-a5d53ce4164bd8a2070435dd7887bdfd0b5480dd.zip
Merge branch 'document-read-until-eof' into 'main'
make read_file_to_str_until_eof doc more explicit Closes #40852 See merge request tpo/core/tor!799
-rw-r--r--src/lib/fs/files.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/fs/files.c b/src/lib/fs/files.c
index 55f20dd49e..df59222913 100644
--- a/src/lib/fs/files.c
+++ b/src/lib/fs/files.c
@@ -572,9 +572,10 @@ write_bytes_to_new_file(const char *fname, const char *str, size_t len,
/**
* Read the contents of the open file <b>fd</b> presuming it is a FIFO
* (or similar) file descriptor for which the size of the file isn't
- * known ahead of time. Return NULL on failure, and a NUL-terminated
- * string on success. On success, set <b>sz_out</b> to the number of
- * bytes read.
+ * known ahead of time.
+ * Return NULL on failure, and a NUL-terminated string on success.
+ * On success, set <b>sz_out</b> to the number of bytes read (not including
+ * the final NULL, which wasn't read from <b>fd</fd>).
*/
char *
read_file_to_str_until_eof(int fd, size_t max_bytes_to_read, size_t *sz_out)