summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-07-31 21:28:03 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-07-31 21:28:03 (GMT)
commit39fd672dfe0bea76d0ae5823b864460757cb423b (patch)
tree291455c98dccac778c5780b1eb4b0cf5f0da3dca /Python
parente7d8be80ba634fa15ece6f503c33592e0d333361 (diff)
downloadcpython-39fd672dfe0bea76d0ae5823b864460757cb423b.zip
cpython-39fd672dfe0bea76d0ae5823b864460757cb423b.tar.gz
cpython-39fd672dfe0bea76d0ae5823b864460757cb423b.tar.bz2
#3479: unichr(2**32) used to return u'\x00'.
The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int. (why doesn't gcc issue a truncation warning in this case?)
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index e18eb2a..4a1ffd5 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -394,9 +394,9 @@ Return a string of one character with ordinal i; 0 <= i < 256.");
static PyObject *
builtin_unichr(PyObject *self, PyObject *args)
{
- long x;
+ int x;
- if (!PyArg_ParseTuple(args, "l:unichr", &x))
+ if (!PyArg_ParseTuple(args, "i:unichr", &x))
return NULL;
return PyUnicode_FromOrdinal(x);