summaryrefslogtreecommitdiff
path: root/host/arch/x86/lib/crossystem_arch.c
diff options
context:
space:
mode:
authorJ. Richard Barnette <jrbarnette@chromium.org>2013-10-30 11:36:45 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-31 21:56:58 +0000
commita3d70a3d2b5c052db039d097aaffa42008da24b5 (patch)
tree40263855d5eef64cea1c729e89397d0f4cef4880 /host/arch/x86/lib/crossystem_arch.c
parentfe2c1a231e3893dc3d7ac314e11b04a18c6948e7 (diff)
downloadvboot-a3d70a3d2b5c052db039d097aaffa42008da24b5.tar.gz
This adds a VB_MAX_STRING_PROPERTY for callers that don't want to guess at how big to make their buffers. Additionally, it changes the size parameter to VbGetPropertyString() from int to size_t. BUG=None TEST=compile the code BRANCH=none Change-Id: I22809d48e13b535593cb22a56444e2dcb27791a5 Reviewed-on: https://chromium-review.googlesource.com/175039 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Diffstat (limited to 'host/arch/x86/lib/crossystem_arch.c')
-rw-r--r--host/arch/x86/lib/crossystem_arch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c
index 9398a35a..2b379a71 100644
--- a/host/arch/x86/lib/crossystem_arch.c
+++ b/host/arch/x86/lib/crossystem_arch.c
@@ -7,6 +7,7 @@
#include <dirent.h>
#include <errno.h>
#include <linux/nvram.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@@ -671,7 +672,8 @@ int VbGetArchPropertyInt(const char* name) {
}
-const char* VbGetArchPropertyString(const char* name, char* dest, int size) {
+const char* VbGetArchPropertyString(const char* name, char* dest,
+ size_t size) {
if (!strcasecmp(name,"arch")) {
return StrCopy(dest, "x86", size);