diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 81e0ba59..60a25eb0 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -380,6 +380,8 @@ static void usage(uint8_t usage_exit); #define NVM_WORDS (NVM_SIZE >> 1) #define NVM_CHECKSUM_WORD (NVM_WORDS - 1) +#define NUM_RANDOM_BYTES 12 + /* * Portable macro based on BSD nitems. * Used to count the number of commands (see below). @@ -566,6 +568,8 @@ typedef char assert_read[(IO_READ==0)?1:-1]; typedef char assert_write[(IO_WRITE==1)?1:-1]; typedef char assert_pread[(IO_PREAD==2)?1:-1]; typedef char assert_pwrite[(IO_PWRITE==3)?1:-1]; +typedef char assert_rand_byte[(NUM_RANDOM_BYTES>0)?1:-1]; +typedef char assert_rand_len[(NUM_RANDOM_BYTES (size_t)SSIZE_MAX || (unsigned int)rw_type > IO_PWRITE) goto err_rw_file_once;