diff --git a/Modules/_struct.c b/Modules/_struct.c index ba8a8ed979e..c1db286b051 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; }