Commit 48c6ee58 authored by Mark Dickinson's avatar Mark Dickinson

Issue #9277: Struct module: standard bool packing was incorrect if

char is unsigned.  Thanks Stefan Krah for the patch.
parent 1c5b456e
......@@ -867,11 +867,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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment