summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/_struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index ba8a8ed..c1db286 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -856,11 +856,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;
}