diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-08 19:07:54 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-08 19:07:54 +0000 |
commit | bdaea730df0500335bad1efac798dbcc537ddd1f (patch) | |
tree | 207b3f4ff97af1de18c70f425cd92d3da3856266 /libgfortran | |
parent | af57a32b09a16e287bcc538fe37536b12ec371ce (diff) | |
download | gcc-bdaea730df0500335bad1efac798dbcc537ddd1f.tar.gz |
* io/backspace.c (unformatted_backspace): Do not dereference
the pointer to the stream.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97851 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 15 | ||||
-rw-r--r-- | libgfortran/io/backspace.c | 11 |
2 files changed, 17 insertions, 9 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 49a43e9b447..51959122810 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2005-04-08 Eric Botcazou <ebotcazou@libertysurf.fr> + + * io/backspace.c (unformatted_backspace): Do not dereference + the pointer to the stream. + 2005-04-07 Andrew Pinski <pinskia@physics.uc.edu> PR libfortran/20766 @@ -1493,7 +1498,7 @@ * libgfortan.h,intrinsics/random.c: Made random_seed visible. * runtime/main.c(init): Call random_seed as part of MAIN init. -2004-05-13 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2004-05-13 Tobias Schlter <tobias.schlueter@physik.uni-muenchen.de> * io/format.c: (parse_format_list): No comma is required after P descriptor. @@ -1950,7 +1955,7 @@ (calculate_G_format): Rewrite it to eliminate an infinte loop and set the scale_factor to 0 for F editing. -2003-05-11 Tobias Schlüter <innenminister@gmx.de> +2003-05-11 Tobias Schlter <innenminister@gmx.de> * libgfor.h: Only include stdint.h if it exists. @@ -1965,11 +1970,11 @@ * libgfor.h (offsetof): Define if nobody else does. * runtime/memory.c (HEADER_SIZE): Use it. -2003-05-01 Tobias Schlüter <innenminister@gmx.de> +2003-05-01 Tobias Schlter <innenminister@gmx.de> * configure.in: Require autoconf 2.54. -2003-04-28 Tobias Schlüter <innenminister@gmx.de> +2003-04-28 Tobias Schlter <innenminister@gmx.de> Paul Brook <paul@nowt.org> * intrinsics/reshape_generic.c: Copy the whole element, not just the @@ -1983,7 +1988,7 @@ * io/format.c (parse_format_list): Allow 'X' without integer prefix. This is an extension. Interpretation is '1X'. -2003-04-18 Tobias Schlüter <Tobias.Schlueter@physik.uni-muenchen.de> +2003-04-18 Tobias Schlter <Tobias.Schlueter@physik.uni-muenchen.de> * io/format.c (parse_format_list): Allow '0P'. diff --git a/libgfortran/io/backspace.c b/libgfortran/io/backspace.c index 225f69cc45a..d4ba3a9baaa 100644 --- a/libgfortran/io/backspace.c +++ b/libgfortran/io/backspace.c @@ -28,6 +28,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" +#include <string.h> #include "libgfortran.h" #include "io.h" @@ -101,17 +102,19 @@ formatted_backspace (void) static void unformatted_backspace (void) { - gfc_offset *p, new; + gfc_offset m, new; int length; + char *p; length = sizeof (gfc_offset); - p = (gfc_offset *) salloc_r_at (current_unit->s, &length, - file_position (current_unit->s) - length); + p = salloc_r_at (current_unit->s, &length, + file_position (current_unit->s) - length); if (p == NULL) goto io_error; - new = file_position (current_unit->s) - *p - 2*length; + memcpy (&m, p, sizeof (gfc_offset)); + new = file_position (current_unit->s) - m - 2*length; if (sseek (current_unit->s, new) == FAILURE) goto io_error; |