malloc to calloc

This commit is contained in:
Jasmine Iwanek
2025-01-07 00:42:06 -05:00
parent f599e72114
commit 4e6f29a7d5
183 changed files with 245 additions and 493 deletions

View File

@@ -316,15 +316,13 @@ fdi_load(int drive, char *fn)
writeprot[drive] = fwriteprot[drive] = 1;
/* Allocate a drive block. */
dev = (fdi_t *) malloc(sizeof(fdi_t));
dev = (fdi_t *) calloc(1, sizeof(fdi_t));
if (dev == NULL) {
memset(floppyfns[drive], 0, sizeof(floppyfns[drive]));
return;
}
memset(dev, 0x00, sizeof(fdi_t));
d86f_unregister(drive);
dev->fp = plat_fopen(fn, "rb");