diff options
author | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-31 17:05:52 +0000 |
---|---|---|
committer | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-31 17:05:52 +0000 |
commit | 452b4a216a6caf31545fe3b3004ba56d436578a7 (patch) | |
tree | 1ccc44de7bff216225ccb4d02ff1d04e6c0ba4e4 /libgfortran/io | |
parent | aaf4f663e7d9b9e0560fca217bf8c0fa189cc7de (diff) | |
download | gcc-452b4a216a6caf31545fe3b3004ba56d436578a7.tar.gz |
* io/read.c (set_integer): Use memcpy to fill buffer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103687 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/read.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index e37224d5f8f..64231b936c2 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"); |