AltairZ80: Fix issue detected by Coverity (unchecked sim_fseek in n8vem.c)

This commit is contained in:
Peter Schorn 2019-03-24 21:51:26 +01:00
parent 5960bca32a
commit ddb4cb4661

View file

@ -279,9 +279,9 @@ static t_stat n8vem_detach(UNIT *uptr)
sim_debug(VERBOSE_MSG, &n8vem_dev, "N8VEM: Detach %s.\n", i == 0 ? "ROM" : "RAM"); sim_debug(VERBOSE_MSG, &n8vem_dev, "N8VEM: Detach %s.\n", i == 0 ? "ROM" : "RAM");
/* rewind to the beginning of the file. */ /* rewind to the beginning of the file. */
sim_fseek(uptr->fileref, 0, SEEK_SET); if(sim_fseek(uptr->fileref, 0, SEEK_SET)) {
sim_debug(VERBOSE_MSG, &n8vem_dev, "N8VEM: Cannot write into %s image.\n", i == 0 ? "ROM" : "RAM");
if(i == 0) { /* ROM */ } else if(i == 0) { /* ROM */
/* Save the ROM back to disk if SAVEROM is set. */ /* Save the ROM back to disk if SAVEROM is set. */
if(save_rom == 1) { if(save_rom == 1) {
sim_debug(VERBOSE_MSG, &n8vem_dev, "N8VEM: Writing %d bytes into ROM image.\n", N8VEM_ROM_SIZE); sim_debug(VERBOSE_MSG, &n8vem_dev, "N8VEM: Writing %d bytes into ROM image.\n", N8VEM_ROM_SIZE);