Fix minor bug in fileseek() routine when seeking to block 512.
This commit is contained in:
parent
e707b2bd9a
commit
d5775dd678
@ -18,7 +18,7 @@ If the emulator is run with no options, it prints a usage screen:
|
||||
E:\DEC> tu58em
|
||||
ERROR: no units were specified
|
||||
FATAL: illegal command line
|
||||
tu58 tape emulator v1.4p
|
||||
tu58 tape emulator v1.4q
|
||||
Usage: ./tu58em [-options] -[rwci] file1 ... -[rwci] file7
|
||||
Options: -V | --version output version string
|
||||
-v | --verbose enable verbose output to terminal
|
||||
|
||||
2
file.c
2
file.c
@ -354,7 +354,7 @@ int32_t fileseek (int32_t unit,
|
||||
{
|
||||
if (fileunit(unit)) return -1;
|
||||
|
||||
if (block*size+offset > lseek(file[unit].fd, 0, SEEK_END)) return -2;
|
||||
if (block*size+offset >= lseek(file[unit].fd, 0, SEEK_END)) return -2;
|
||||
|
||||
if (lseek(file[unit].fd, block*size+offset, SEEK_SET) < 0) return -3;
|
||||
|
||||
|
||||
5
main.c
5
main.c
@ -74,10 +74,11 @@
|
||||
// - Added M. Blair's background mode option (no status).
|
||||
// v1.4n - 06 Apr 2016 - donorth - Added capability for baud rates >230K, up to 3M
|
||||
// v1.4o - 09 Jan 2017 - donorth - Removed baud rate 256000, it is nonstandard for unix.
|
||||
// Changed serial setup to use cfsetispeed()/cfsetospeed().
|
||||
// Changed serial setup to use cfsetispeed()/cfsetospeed()
|
||||
// Added capability for 1 or 2 stop bits; default is 1
|
||||
// v1.4p - 05 May 2017 - donorth - Updated serial baud rate table with #ifdef detection
|
||||
// Update clock_gettime() for MAC OSX support
|
||||
// v1.4q - 16 May 2017 - donorth - Fixed error in fileseek() routine (should fail at EOF)
|
||||
//
|
||||
|
||||
|
||||
@ -88,7 +89,7 @@
|
||||
static char copyright[] = "(C) 2005-2017 Don North <ak6dn" "@" "mindspring.com>, " \
|
||||
"(C) 1984 Dan Ts'o <Rockefeller University>";
|
||||
|
||||
static char version[] = "tu58 tape emulator v1.4p";
|
||||
static char version[] = "tu58 tape emulator v1.4q";
|
||||
|
||||
static char port[32] = "1"; // default port number (COM1, /dev/ttyS0)
|
||||
static long speed = 9600; // default line speed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user