summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-07-18 08:01:37 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-07-18 08:01:37 (GMT)
commita63726ffc887cdfc775b9ef6b4091a12511a5555 (patch)
treeb89c4e2787df6eb0730349d670f03aee8fb34572 /Modules
parent818ea8ed1171ffb87f74d1ba7fc4e4fecbd4a2ba (diff)
downloadcpython-a63726ffc887cdfc775b9ef6b4091a12511a5555.zip
cpython-a63726ffc887cdfc775b9ef6b4091a12511a5555.tar.gz
cpython-a63726ffc887cdfc775b9ef6b4091a12511a5555.tar.bz2
Merged revisions 82945 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r82945 | mark.dickinson | 2010-07-18 08:55:55 +0100 (Sun, 18 Jul 2010) | 14 lines Merged revisions 82941,82943 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82941 | mark.dickinson | 2010-07-18 08:29:02 +0100 (Sun, 18 Jul 2010) | 3 lines Issue #9277: Struct module: standard bool packing was incorrect if char is unsigned. Thanks Stefan Krah for the patch. ........ r82943 | mark.dickinson | 2010-07-18 08:48:20 +0100 (Sun, 18 Jul 2010) | 1 line Misc/NEWS entry for r82941. ........ ................
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index b997d51..936e8af 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1013,9 +1013,9 @@ bp_double(char *p, PyObject *v, const formatdef *f)
static int
bp_bool(char *p, PyObject *v, const formatdef *f)
{
- char y;
+ int y;
y = PyObject_IsTrue(v);
- memcpy(p, (char *)&y, sizeof y);
+ *p = (char)y;
return 0;
}