From 2ad8c56e6c77f5eb04a9004f525b59ee717a8f3d Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Thu, 16 Feb 2006 20:19:46 +0000 Subject: [PATCH] struct_pack(): Repair new assert-fail crash in debug-build test_struct on a box where plain "char" is signed. --- Modules/structmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/structmodule.c b/Modules/structmodule.c index 2fa6e909c55..4713c0cf76b 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; }