From c152d551de033b8b99c992305c0de5b61e981fa4 Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Mon, 24 Oct 2022 17:56:33 -0400 Subject: [PATCH] fix OW warning W115 cast array using pointer to first element [newboot] instead of pointer to whole array [&newboot] to avoid OW error W115 "&array may not produce intended result" since the address of operator "&" is not required for getting the address of an array. --- sys/sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys.c b/sys/sys.c index 75a8394..76f69e8 100644 --- a/sys/sys.c +++ b/sys/sys.c @@ -1485,7 +1485,7 @@ void put_boot(SYSOptions *opts) saveBS(opts->bsFileOrig, oldboot); } - bs = (struct bootsectortype *)&oldboot; + bs = (struct bootsectortype *)oldboot; if (bs->bsBytesPerSec != SEC_SIZE) { @@ -1611,7 +1611,7 @@ void put_boot(SYSOptions *opts) #endif memcpy(&newboot[SBOFFSET], &oldboot[SBOFFSET], SBSIZE); - bs = (struct bootsectortype *)&newboot; + bs = (struct bootsectortype *)newboot; /* originally OemName was "FreeDOS", changed for better compatibility */ memcpy(bs->OemName, "FRDOS5.1", 8); /* Win9x seems to require @@ -1621,7 +1621,7 @@ void put_boot(SYSOptions *opts) #ifdef WITHFAT32 if (fs == FAT32) { - bs32 = (struct bootsectortype32 *)&newboot; + bs32 = (struct bootsectortype32 *)newboot; /* ensure appears valid, if not then force valid */ if ((bs32->bsBackupBoot < 1) || (bs32->bsBackupBoot > bs32->bsResSectors)) { @@ -1781,7 +1781,7 @@ void put_boot(SYSOptions *opts) */ if ((fs == FAT32) && !opts->skipBakBSCopy) { - bs32 = (struct bootsectortype32 *)&newboot; + bs32 = (struct bootsectortype32 *)newboot; #ifdef DEBUG printf("writing backup bootsector to sector %d\n", bs32->bsBackupBoot); #endif