From 1eec9fcc2cc5be654860c85703c473ef9c16da6d Mon Sep 17 00:00:00 2001 From: Nibble Date: Fri, 21 May 2010 01:34:35 +0200 Subject: [PATCH] * r_io - Fix lseek * r_hash - Remove debug printf from t/hello.c --- libr/hash/t/hello.c | 1 - libr/io/io.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libr/hash/t/hello.c b/libr/hash/t/hello.c index cfa16ae5d3..6be43315e4 100644 --- a/libr/hash/t/hello.c +++ b/libr/hash/t/hello.c @@ -25,7 +25,6 @@ int main(int argc, char **argv) /* get file size */ size = r_io_size(io, fd); - eprintf ("AAA: %lli\n", size); /* read bytes */ buf = (ut8*) malloc(size); diff --git a/libr/io/io.c b/libr/io/io.c index 0f283f3918..db04c08f7f 100644 --- a/libr/io/io.c +++ b/libr/io/io.c @@ -265,7 +265,7 @@ R_API ut64 r_io_seek(struct r_io_t *io, ut64 offset, int whence) { posix_whence = SEEK_CUR; break; case R_IO_SEEK_END: - offset = UT64_MAX; // XXX: depending on io bits? + //offset = UT64_MAX; // XXX: depending on io bits? posix_whence = SEEK_END; break; } @@ -276,7 +276,7 @@ R_API ut64 r_io_seek(struct r_io_t *io, ut64 offset, int whence) { // XXX can be problematic on w32..so no 64 bit offset? else len = lseek (io->fd, offset, posix_whence); if (len != -1) { - io->off = offset; + io->off = len; // XXX this can be tricky.. better not to use this .. must be deprecated // r_io_sundo_push (io); ret = io->va ? r_io_section_offset_to_vaddr (io, io->off) : io->off;