From: Tim Peters Date: Thu, 16 Feb 2006 20:19:46 +0000 (+0000) Subject: struct_pack(): Repair new assert-fail crash in X-Git-Tag: v2.5a0~643 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ad8c56e6c77f5eb04a9004f525b59ee717a8f3d;p=python struct_pack(): Repair new assert-fail crash in debug-build test_struct on a box where plain "char" is signed. --- diff --git a/Modules/structmodule.c b/Modules/structmodule.c index 2fa6e909c5..4713c0cf76 100644 --- a/Modules/structmodule.c +++ b/Modules/structmodule.c @@ -1134,7 +1134,7 @@ struct_pack(PyObject *self, PyObject *args) if (n > 255) n = 255; /* store the length byte */ - *res++ = Py_SAFE_DOWNCAST(n, Py_ssize_t, char); + *res++ = Py_SAFE_DOWNCAST(n, Py_ssize_t, unsigned char); res += num; break; }