Mercurial > hg > dmlib
changeset 406:a0160ffdf7e5
Use fseeko() and ftello() to ensure 64-bit off_t compatibility in stdio backend.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 03 Nov 2012 01:54:00 +0200 |
parents | d0257d0004f6 |
children | 59244a7ae37f |
files | dmres.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/dmres.c Sat Nov 03 01:42:45 2012 +0200 +++ b/dmres.c Sat Nov 03 01:54:00 2012 +0200 @@ -179,15 +179,15 @@ return f->dataSize; // Get file size - savePos = ftell(f->fh); - if (fseek(f->fh, 0L, SEEK_END) != 0) + savePos = ftello(f->fh); + if (fseeko(f->fh, 0L, SEEK_END) != 0) { f->error = dmGetErrno(); return -1; } - fileSize = ftell(f->fh); - if (fseek(f->fh, savePos, SEEK_SET) != 0) + fileSize = ftello(f->fh); + if (fseeko(f->fh, savePos, SEEK_SET) != 0) { f->error = dmGetErrno(); return -1;