diff options
author | FreeArtMan <dos21h@gmail.com> | 2019-10-06 14:36:17 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2019-10-06 14:36:17 +0100 |
commit | 786bd1e76c6806a4c9272814f9ffe7d901998e4e (patch) | |
tree | 8b1e38e48a766c5a8dbad7f00ffb63d09376426c /core.c | |
parent | 8a8e0941dd2ab5f089662362a30c91e16de18ce0 (diff) | |
download | ihe-786bd1e76c6806a4c9272814f9ffe7d901998e4e.tar.gz ihe-786bd1e76c6806a4c9272814f9ffe7d901998e4e.zip |
Fix seek command, tested/works relative seek, and hex positioning support
Diffstat (limited to 'core.c')
-rw-r--r-- | core.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -28,7 +28,7 @@ int fd_seek( int fd, off_t offset, int whence ) off_new = lseek( fd, offset, whence ); if ( errno != 0) { - printf("Cannot seek %s\n", strerror(errno)); + printf("!Cannot seek %s\n", strerror(errno)); errno = 0; //why i need to reset it? return -1; } @@ -145,7 +145,7 @@ int file_seek( file_t *ft, off_t offset ) ret = fd_seek( ft->fd, offset, FD_SEEK_CUR ); - if (ret == 0) + if (ret >= 0) { new_off = fd_pos( ft->fd ); if (new_off > ft->size) |