summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/intrinsics/random.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index a74bd448151..2305b3e9ed6 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/33077
+ * intrinsics/random.c (random_seed_i8): Fix code logic.
+
2007-08-13 Danny Smith <dannysmit@users.sourceforge.net>
* acinclude.m4 (GTHREAD_USE_WEAK) Define to 0 for mingw32.
diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c
index f64f21c5b80..00029c5da61 100644
--- a/libgfortran/intrinsics/random.c
+++ b/libgfortran/intrinsics/random.c
@@ -731,8 +731,8 @@ random_seed_i8 (GFC_INTEGER_8 *size, gfc_array_i8 *put, gfc_array_i8 *get)
runtime_error ("Array size of PUT is too small.");
/* This code now should do correct strides. */
- for (i = 0; i < kiss_size; i += 2)
- memcpy (&kiss_seed[i], &(put->data[i * put->dim[0].stride]),
+ for (i = 0; i < kiss_size / 2; i++)
+ memcpy (&kiss_seed[2*i], &(put->data[i * put->dim[0].stride]),
sizeof (GFC_UINTEGER_8));
}
@@ -748,8 +748,8 @@ random_seed_i8 (GFC_INTEGER_8 *size, gfc_array_i8 *put, gfc_array_i8 *get)
runtime_error ("Array size of GET is too small.");
/* This code now should do correct strides. */
- for (i = 0; i < kiss_size; i += 2)
- memcpy (&(get->data[i * get->dim[0].stride]), &kiss_seed[i],
+ for (i = 0; i < kiss_size / 2; i++)
+ memcpy (&(get->data[i * get->dim[0].stride]), &kiss_seed[2*i],
sizeof (GFC_UINTEGER_8));
}