diff options
| author | R David Murray <rdmurray@bitdance.com> | 2013-03-20 22:12:14 -0400 |
|---|---|---|
| committer | R David Murray <rdmurray@bitdance.com> | 2013-03-20 22:12:14 -0400 |
| commit | 4f9e787189db3d142c18d45c2757f07c0ea8413e (patch) | |
| tree | a283eb5ef2027fbd090f079001dd03090782ce40 /Python/modsupport.c | |
| parent | 7ddb402f873b3a7242d4f129060073971f4ef536 (diff) | |
| parent | 5a798963eadb3caa3261326f6bb6925d127ffb5b (diff) | |
| download | cpython-4f9e787189db3d142c18d45c2757f07c0ea8413e.tar.gz | |
Merge: #5712: Preemptively fix some other possible timing issues.
Diffstat (limited to 'Python/modsupport.c')
| -rw-r--r-- | Python/modsupport.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c index 85b0d66358..428914f378 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -148,15 +148,6 @@ do_mklist(const char **p_format, va_list *p_va, int endchar, int n, int flags) return v; } -static int -_ustrlen(Py_UNICODE *u) -{ - int i = 0; - Py_UNICODE *v = u; - while (*v != 0) { i++; v++; } - return i; -} - static PyObject * do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags) { @@ -269,7 +260,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags) } else { if (n < 0) - n = _ustrlen(u); + n = Py_UNICODE_strlen(u); v = PyUnicode_FromUnicode(u, n); } return v; @@ -292,11 +283,6 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags) case 'C': { int i = va_arg(*p_va, int); - if (i < 0 || i > PyUnicode_GetMax()) { - PyErr_SetString(PyExc_OverflowError, - "%c arg not in range(0x110000)"); - return NULL; - } return PyUnicode_FromOrdinal(i); } |
