diff --git a/sim_disk.c b/sim_disk.c index c1309702..a0b290b5 100644 --- a/sim_disk.c +++ b/sim_disk.c @@ -4142,10 +4142,10 @@ VhdPathToHostPath (const char *szVhdPath, char *c; char *d = szHostPath; -strncpy (szHostPath, szVhdPath, HostPathSize-1); +memmove (szHostPath, szVhdPath, HostPathSize); szHostPath[HostPathSize-1] = '\0'; #if defined(VMS) -c = strchr (szVhdPath, ':'); +c = strchr (szHostPath, ':'); if (*(c+1) != '\\') return NULL; *(c+1) = '['; diff --git a/sim_fio.c b/sim_fio.c index 5f13e4b8..19d280f2 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -291,40 +291,12 @@ return (t_offset)(ftell (st)); int sim_fseeko (FILE *st, t_offset offset, int whence) { -fpos_t fileaddr; -struct _stati64 statb; - -switch (whence) { - - case SEEK_SET: - fileaddr = (fpos_t)offset; - break; - - case SEEK_END: - if (_fstati64 (_fileno (st), &statb)) - return (-1); - fileaddr = statb.st_size + offset; - break; - case SEEK_CUR: - if (fgetpos (st, &fileaddr)) - return (-1); - fileaddr = fileaddr + offset; - break; - - default: - errno = EINVAL; - return (-1); - } - -return fsetpos (st, &fileaddr); +return _fseeki64 (st, (__int64)offset, whence); } t_offset sim_ftell (FILE *st) { -fpos_t fileaddr; -if (fgetpos (st, &fileaddr)) - return (-1); -return (t_offset)fileaddr; +return (t_offset)_ftelli64 (st); } #endif /* end Windows */ diff --git a/sim_tape.c b/sim_tape.c index 3d1004c3..0cbfbe6d 100644 --- a/sim_tape.c +++ b/sim_tape.c @@ -1312,6 +1312,7 @@ switch (f) { /* case on format */ case MTUF_F_STD: /* standard */ sbc = MTR_L ((bc + 1) & ~1); /* pad odd length */ + /* fall through into the E11 handler */ case MTUF_F_E11: /* E11 */ sim_fwrite (&bc, sizeof (t_mtrlnt), 1, uptr->fileref); sim_fwrite (buf, sizeof (uint8), sbc, uptr->fileref);