use calloc to hopefully not read random stuff
This commit is contained in:
@@ -226,7 +226,7 @@ void startEmulator(Emulator* emu) {
|
||||
}
|
||||
|
||||
Emulator* initEmulator(uint32_t memorySize) {
|
||||
Emulator* newEmu = malloc(sizeof(Emulator));
|
||||
Emulator* newEmu = calloc(1, sizeof(Emulator));
|
||||
if (!newEmu)
|
||||
return NULL;
|
||||
|
||||
@@ -256,4 +256,4 @@ void freeEmulator(Emulator* emu) {
|
||||
void installDevice(Emulator* emu, Device* device, uint8_t deviceNumber) {
|
||||
assert(deviceNumber < MAX_DEVICES);
|
||||
emu->devices[deviceNumber] = device;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user