aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-07-15 05:29:29 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-07-15 05:29:29 +0000
commitd40150cc3c1e85a9cbbaebb2679b6bac7a62ecbc (patch)
treedf8dbebd175229f5dd9969678dbf00c011fd21d9 /libgfortran/io/unix.c
parent6816e2e17db97a384cac3f66247a4acb37c4432a (diff)
downloadgcc-d40150cc3c1e85a9cbbaebb2679b6bac7a62ecbc.zip
gcc-d40150cc3c1e85a9cbbaebb2679b6bac7a62ecbc.tar.gz
gcc-d40150cc3c1e85a9cbbaebb2679b6bac7a62ecbc.tar.bz2
re PR libfortran/32752 (Segfault on WRITE with modified unix_stream structure)
2007-07-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/32752 * io/unix.c (unix_stream): Move buffer pointer adjacent to small_buffer. * io/transfer.c (formatted_transfer_scalar): If stream I/O, set bytes_used to zero. Fix off by one error in calculation of pos and skips. Eliminate duplicate pending_spaces check. From-SVN: r126652
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index bdfd245..ded0d05 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -97,7 +97,6 @@ typedef struct
gfc_offset dirty_offset; /* Start of modified bytes in buffer */
gfc_offset file_length; /* Length of the file, -1 if not seekable. */
- char *buffer;
int len; /* Physical length of the current buffer */
int active; /* Length of valid bytes in the buffer */
@@ -108,6 +107,7 @@ typedef struct
int unbuffered; /* =1 if the stream is not buffered */
+ char *buffer;
char small_buffer[BUFFER_SIZE];
}
unix_stream;
@@ -587,7 +587,7 @@ fd_alloc_w_at (unix_stream * s, int *len, gfc_offset where)
s->ndirty = where + *len - start;
else
s->ndirty = s->dirty_offset + s->ndirty - start;
- s->dirty_offset = start;
+ s->dirty_offset = start;
}
s->logical_offset = where + *len;