summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2022-02-28 11:41:03 -0800
committerCommit Bot <commit-bot@chromium.org>2022-02-28 22:05:42 +0000
commit79339f987f951d8380be1121415f3451f467b368 (patch)
tree3f859ca5e192420780b758a0a4869ff05c1311ce /fuzz
parent0178a84bbd61dfb4dfca803082659cefdf05466f (diff)
downloadchrome-ec-79339f987f951d8380be1121415f3451f467b368.tar.gz
fuzz: Stop mixing decl + initialization
Initialization with dec is supported only in C99 mode which EC code is apparently not. Fixes error with newer clang: 'mixing declarations and code is incompatible with standards before C99' BUG=b:221860687 TEST=emerge chromeos-ec BRANCH=none Change-Id: Iefe0f1445389de9dfab60dfbaf805d4de1b4165b Signed-off-by: Manoj Gupta <manojgupta@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3495868 Tested-by: Manoj Gupta <manojgupta@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/host_command_fuzz.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fuzz/host_command_fuzz.c b/fuzz/host_command_fuzz.c
index e055f4a73f..4e30a5e8c1 100644
--- a/fuzz/host_command_fuzz.c
+++ b/fuzz/host_command_fuzz.c
@@ -56,6 +56,9 @@ struct chunk {
static int hostcmd_fill(const uint8_t *data, size_t size)
{
static int first = 1;
+ int ipos = 0;
+ int i;
+ int req_size = 0;
#ifdef VALID_REQUEST_ONLY
const int checksum_offset = offsetof(struct ec_host_request, checksum);
@@ -75,10 +78,6 @@ static int hostcmd_fill(const uint8_t *data, size_t size)
struct chunk chunks[1] = { {0, sizeof(req_buf)} };
#endif
- int ipos = 0;
- int i;
- int req_size = 0;
-
/*
* TODO(chromium:854975): We should probably malloc req_buf with the
* correct size, to make we do not read uninitialized req_buf data.