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.
This commit is contained in:
Kenneth J Davis 2022-10-24 17:56:33 -04:00 committed by GitHub
parent 9d799c2a1e
commit c152d551de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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