diff options
| -rw-r--r-- | libgfortran/ChangeLog | 4 | ||||
| -rw-r--r-- | libgfortran/io/read.c | 25 |
2 files changed, 24 insertions, 5 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 44a9fcf..5883d29 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,5 +1,9 @@ 2005-08-31 Steve Ellcey <sje@cup.hp.com> + * io/read.c (set_integer): Use memcpy to fill buffer. + +2005-08-31 Steve Ellcey <sje@cup.hp.com> + PR target/23556 * io/read.c (convert_real): Use memcpy to fill buffer. diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index e37224d..64231b9 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -49,20 +49,35 @@ set_integer (void *dest, GFC_INTEGER_LARGEST value, int length) { #ifdef HAVE_GFC_INTEGER_16 case 16: - *((GFC_INTEGER_16 *) dest) = value; + { + GFC_INTEGER_16 tmp = value; + memcpy (dest, (void *) &tmp, length); + } break; #endif case 8: - *((GFC_INTEGER_8 *) dest) = value; + { + GFC_INTEGER_8 tmp = value; + memcpy (dest, (void *) &tmp, length); + } break; case 4: - *((GFC_INTEGER_4 *) dest) = value; + { + GFC_INTEGER_4 tmp = value; + memcpy (dest, (void *) &tmp, length); + } break; case 2: - *((GFC_INTEGER_2 *) dest) = value; + { + GFC_INTEGER_2 tmp = value; + memcpy (dest, (void *) &tmp, length); + } break; case 1: - *((GFC_INTEGER_1 *) dest) = value; + { + GFC_INTEGER_1 tmp = value; + memcpy (dest, (void *) &tmp, length); + } break; default: internal_error ("Bad integer kind"); |
