Skip to content

Commit

Permalink
Merge pull request #83 from ghaerr/proto
Browse files Browse the repository at this point in the history
Fix passing arguments to a function without a prototype
  • Loading branch information
mfld-fr authored Aug 2, 2023
2 parents 9844dd0 + dd6c9e9 commit 16dfcf0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rom-pcxtat.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,12 @@ static int readwrite_sector (byte_t drive, int wflag, unsigned long lba,
while (1)
{
ssize_t l;
ssize_t (*op)();

off_t o = lseek (dp->fd, lba * SECTOR_SIZE, SEEK_SET);
if (o == -1) break;

op = read;
if (wflag) op = write;
l = (*op) (dp->fd, mem_get_addr (addr_seg_off (seg, off)), SECTOR_SIZE);
if (wflag) l = write(dp->fd, mem_get_addr (addr_seg_off (seg, off)), SECTOR_SIZE);
else l = read(dp->fd, mem_get_addr (addr_seg_off (seg, off)), SECTOR_SIZE);
if (l != SECTOR_SIZE) break;

// success
Expand Down

0 comments on commit 16dfcf0

Please sign in to comment.