]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - libio/iofgetpos.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / libio / iofgetpos.c
index aa02481cccf4a78d6fa3be1f9082cd72956ac481..06ac51bb3464d779190587508156570bacb493e2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.
+   <https://www.gnu.org/licenses/>.
 
    As a special exception, if you link the code in this file with
    files compiled with a GNU compiler to produce an executable,
@@ -42,9 +42,9 @@
 #include <shlib-compat.h>
 
 int
-_IO_new_fgetpos (_IO_FILE *fp, _IO_fpos_t *posp)
+_IO_new_fgetpos (FILE *fp, __fpos_t *posp)
 {
-  _IO_off64_t pos;
+  off64_t pos;
   int result = 0;
   CHECK_FILE (fp, EOF);
   _IO_acquire_lock (fp);
@@ -62,7 +62,7 @@ _IO_new_fgetpos (_IO_FILE *fp, _IO_fpos_t *posp)
        __set_errno (EIO);
       result = EOF;
     }
-  else if ((_IO_off64_t) (__typeof (posp->__pos)) pos != pos)
+  else if ((off64_t) (__typeof (posp->__pos)) pos != pos)
     {
       __set_errno (EOVERFLOW);
       result = EOF;
@@ -70,8 +70,7 @@ _IO_new_fgetpos (_IO_FILE *fp, _IO_fpos_t *posp)
   else
     {
       posp->__pos = pos;
-      if (fp->_mode > 0
-         && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
+      if (fp->_mode > 0 && __libio_codecvt_encoding (fp->_codecvt) < 0)
        /* This is a stateful encoding, safe the state.  */
        posp->__state = fp->_wide_data->_IO_state;
     }