summaryrefslogtreecommitdiff
path: root/host/lib/include/host_misc.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2020-09-24 15:54:39 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-05 12:26:04 +0000
commit7c6bf3080a20077f1da49bc383297ac33bce35f8 (patch)
tree089b5f738bba8822d09e9d9d819e080c67e89416 /host/lib/include/host_misc.h
parenta5c13bc047d656545d8f9ff345d49e636f678311 (diff)
downloadvboot-7c6bf3080a20077f1da49bc383297ac33bce35f8.tar.gz
lib21: always append '\0' in vb2_readfilestabilize-rust-13514.B
For utilities reading text file, it is easier to process as ASCIIZ input if vb2_readfile can always return a buffer ends with '\0' so we don't need to pass and check the size. BUG=None TEST=make clean && make runtests BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: Ib6294969fb325b9b7899e6295fb1817ad91a9952 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2426092 Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'host/lib/include/host_misc.h')
-rw-r--r--host/lib/include/host_misc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/host/lib/include/host_misc.h b/host/lib/include/host_misc.h
index 9759d44d..0249420b 100644
--- a/host/lib/include/host_misc.h
+++ b/host/lib/include/host_misc.h
@@ -44,6 +44,7 @@ vb2_error_t WriteFile(const char* filename, const void *data, uint64_t size);
/**
* Read data from a file into a newly allocated buffer.
+ * The buffer will end with an extra null byte ('\0', not counted in size).
*
* @param filename Name of file to read from
* @param data_ptr On exit, pointer to newly allocated buffer with data