summaryrefslogtreecommitdiffstats
path: root/Modules/structmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-04 19:10:35 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-04 19:10:35 (GMT)
commit524b588553afb0759c5be590a7aa41db92dcd2ae (patch)
treeb71384583af38722ebda222f40bb5db5e852285e /Modules/structmodule.c
parentb9f8d6e54d72d108648a411174e57779c212871a (diff)
downloadcpython-524b588553afb0759c5be590a7aa41db92dcd2ae.zip
cpython-524b588553afb0759c5be590a7aa41db92dcd2ae.tar.gz
cpython-524b588553afb0759c5be590a7aa41db92dcd2ae.tar.bz2
Added 1995 to copyright message.
Setup.in: clarified Tk comments somewhat. structmodule.c: use memcpy() instead of double precision assignment.
Diffstat (limited to 'Modules/structmodule.c')
-rw-r--r--Modules/structmodule.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/structmodule.c b/Modules/structmodule.c
index 7d8815e..a0ecb67 100644
--- a/Modules/structmodule.c
+++ b/Modules/structmodule.c
@@ -1,6 +1,6 @@
/***********************************************************
-Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
-Amsterdam, The Netherlands.
+Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
+The Netherlands.
All Rights Reserved
@@ -290,7 +290,7 @@ struct_pack(self, args)
res += sizeof(float);
break;
case 'd':
- *(double*)res = fval;
+ memcpy(res, (char*)&fval, sizeof fval);
res += sizeof(double);
break;
}
@@ -415,9 +415,13 @@ struct_unpack(self, args)
break;
case 'd':
- v = newfloatobject(*(double*)str);
+ {
+ double d;
+ memcpy((char *)&d, str, sizeof d);
+ v = newfloatobject(d);
str += sizeof(double);
break;
+ }
default:
err_setstr(StructError, "bad char in fmt");