Fix the following compilation error occurring on 32bit machines:
swtpm_nvstore_linear_file.c: In function 'SWTPM_NVRAM_LinearFile_Mmap':
swtpm_nvstore_linear_file.c:58:20: error: comparison of integer expressions of different signedness: '__off_t' {aka 'long int'} and 'unsigned int' [-Werror=sign-compare]
58 | if (st.st_size >= (uint32_t)sizeof(struct nvram_linear_hdr)) {
| ^~
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
goto fail;
}
- if (st.st_size >= (uint32_t)sizeof(struct nvram_linear_hdr)) {
+ if (st.st_size >= (off_t)sizeof(struct nvram_linear_hdr)) {
/* valid regular file-ish */
mmap_state.size = st.st_size;
mmap_state.can_truncate = true;