diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2017-12-18 22:15:27 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2017-12-18 22:15:27 +0300 |
commit | dc2d175721df8ceb801d50581df95b49c26a6ff7 (patch) | |
tree | 974e4244d749f3efea2d33e1c9dd8dde71c855eb /newlib/libc/stdio | |
parent | 1251555311100fc04550201f838a22c3193821ad (diff) |
newlib: ftello{64}: Fix type of returned value
Especially don't just use -1L since _off_t/_off64_t are not
guaranteed to be of type long.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r-- | newlib/libc/stdio/ftello.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/newlib/libc/stdio/ftello.c b/newlib/libc/stdio/ftello.c index c120c26a9..0a9bb7bd6 100644 --- a/newlib/libc/stdio/ftello.c +++ b/newlib/libc/stdio/ftello.c @@ -99,7 +99,7 @@ _DEFUN(_ftello_r, (ptr, fp), { ptr->_errno = ESPIPE; _newlib_flockfile_exit (fp); - return -1L; + return (_off_t) -1; } /* Find offset of underlying I/O object, then adjust for buffered @@ -113,10 +113,10 @@ _DEFUN(_ftello_r, (ptr, fp), else { pos = fp->_seek (ptr, fp->_cookie, (_fpos_t) 0, SEEK_CUR); - if (pos == -1L) + if (pos == (_fpos_t) -1) { _newlib_flockfile_exit (fp); - return pos; + return (_off_t) -1; } } if (fp->_flags & __SRD) @@ -141,7 +141,7 @@ _DEFUN(_ftello_r, (ptr, fp), } _newlib_flockfile_end (fp); - return pos; + return (_off_t) pos; } #ifndef _REENT_ONLY |