From c309bf7aef4229b7e076ac2e208ffa9386c3611b Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 1 Jan 2020 11:48:36 +0000 Subject: [PATCH] Avoid mixing signed/unsigned arguments to the ? operator. --- usr.bin/mkubootimage/mkubootimage.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/mkubootimage/mkubootimage.c b/usr.bin/mkubootimage/mkubootimage.c index 6f597d6d45b7..426b2bb0f04b 100644 --- a/usr.bin/mkubootimage/mkubootimage.c +++ b/usr.bin/mkubootimage/mkubootimage.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkubootimage.c,v 1.28 2020/01/01 10:35:10 skrll Exp $ */ +/* $NetBSD: mkubootimage.c,v 1.29 2020/01/01 11:48:36 martin Exp $ */ /*- * Copyright (c) 2010 Jared D. McNeill @@ -30,7 +30,7 @@ #endif #include -__RCSID("$NetBSD: mkubootimage.c,v 1.28 2020/01/01 10:35:10 skrll Exp $"); +__RCSID("$NetBSD: mkubootimage.c,v 1.29 2020/01/01 11:48:36 martin Exp $"); #include #include @@ -335,7 +335,7 @@ generate_header_uimg(struct uboot_image_header *hdr, int kernel_fd) crc = crc32v(iov, 3); } else { dsize = update_image ? - st.st_size - sizeof(*hdr) : st.st_size; + (uint32_t)st.st_size - sizeof(*hdr) : (uint32_t)st.st_size; crc = crc32(p, st.st_size); } munmap(p, st.st_size); @@ -389,7 +389,7 @@ generate_header_arm64(struct arm64_image_header *hdr, int kernel_fd) #endif const uint64_t dsize = update_image ? - st.st_size - sizeof(*hdr) : st.st_size; + (uint64_t)st.st_size - sizeof(*hdr) : (uint64_t)st.st_size; memset(hdr, 0, sizeof(*hdr)); hdr->code0 = htole32(ARM64_CODE0);