summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-29 02:49:45 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-29 02:49:45 +0000
commitfe0171a5934f4f32a6c88cf7c95ee937d772792e (patch)
tree17f01f33c20a91178bd54baf36472975f9e50cd3 /libgfortran
parent513269baf70cbe50d152168cff1382633428a86a (diff)
downloadgcc-fe0171a5934f4f32a6c88cf7c95ee937d772792e.tar.gz
2014-06-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/61640 * io/list_read.c (next_char_internal): Adjust the read length to a single wide character. (eat_spaces): Add missing paren. * io/unix.c (mem_read4): Use the correct mem_alloc function for wide character internal reads. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212118 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/io/list_read.c4
-rw-r--r--libgfortran/io/unix.c4
3 files changed, 12 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index c4e9949c9d7..10761e1c57c 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2014-06-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/61640
+ * io/list_read.c (next_char_internal): Adjust the read length to
+ a single wide character. (eat_spaces): Add missing paren.
+ * io/unix.c (mem_read4): Use the correct mem_alloc function for
+ wide character internal reads.
+
2014-06-28 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/29383
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 96db0594b90..1cb329f7df4 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -273,7 +273,7 @@ next_char_internal (st_parameter_dt *dtp)
/* Get the next character and handle end-of-record conditions. */
if (dtp->common.unit) /* Check for kind=4 internal unit. */
- length = sread (dtp->u.p.current_unit->s, &c, sizeof (gfc_char4_t));
+ length = sread (dtp->u.p.current_unit->s, &c, 1);
else
{
char cc;
@@ -399,7 +399,7 @@ eat_spaces (st_parameter_dt *dtp)
{
for (i = 0; i < dtp->u.p.current_unit->bytes_left; i++)
{
- if (dtp->internal_unit[offset + i * sizeof (gfc_char4_t)]
+ if (dtp->internal_unit[(offset + i) * sizeof (gfc_char4_t)]
!= (gfc_char4_t)' ')
break;
}
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index c9866d3495a..9ad293b60a4 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -808,10 +808,10 @@ mem_read4 (stream * s, void * buf, ssize_t nbytes)
void *p;
int nb = nbytes;
- p = mem_alloc_r (s, &nb);
+ p = mem_alloc_r4 (s, &nb);
if (p)
{
- memcpy (buf, p, nb);
+ memcpy (buf, p, nb * 4);
return (ssize_t) nb;
}
else