summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-07-18 07:55:55 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-07-18 07:55:55 (GMT)
commitcac0b83b3583986eae4b84299e023af32e719b95 (patch)
tree03da19dde599447d6c5a8497bd5e3697db55c732 /Modules
parent5dba6dfe6a8224a54c3a4fd5cc2393a734718a77 (diff)
downloadcpython-cac0b83b3583986eae4b84299e023af32e719b95.zip
cpython-cac0b83b3583986eae4b84299e023af32e719b95.tar.gz
cpython-cac0b83b3583986eae4b84299e023af32e719b95.tar.bz2
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 52c5eeb..f22c31c 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -912,11 +912,11 @@ 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);
if (y < 0)
return -1;
- memcpy(p, (char *)&y, sizeof y);
+ *p = (char)y;
return 0;
}