summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/_localemodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 1fba6b1..af36a59 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -58,7 +58,7 @@ str2uni(const char* s)
PyErr_SetString(PyExc_ValueError, "Cannot convert byte to string");
return NULL;
}
- if (needed < sizeof(smallbuf))
+ if (needed*sizeof(wchar_t) < sizeof(smallbuf))
dest = smallbuf;
else {
dest = PyMem_Malloc((needed+1)*sizeof(wchar_t));