From c4f281eba3f2b33bc0a7d7172c44f3d1237c09b3 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 11 Oct 2011 22:11:42 +0200 Subject: Fix misuse of PyUnicode_GET_SIZE, use PyUnicode_GET_LENGTH instead --- Modules/syslogmodule.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Modules/syslogmodule.c') diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index f6dadf43fa..c7a2487d29 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -90,18 +90,16 @@ syslog_get_argv(void) if (!PyUnicode_Check(scriptobj)) { return(NULL); } - scriptlen = PyUnicode_GET_SIZE(scriptobj); + scriptlen = PyUnicode_GET_LENGTH(scriptobj); if (scriptlen == 0) { return(NULL); } - slash = PyUnicode_FindChar(scriptobj, SEP, - 0, PyUnicode_GET_LENGTH(scriptobj), -1); + slash = PyUnicode_FindChar(scriptobj, SEP, 0, scriptlen, -1); if (slash == -2) return NULL; if (slash != -1) { - return PyUnicode_Substring(scriptobj, slash, - PyUnicode_GET_LENGTH(scriptobj)); + return PyUnicode_Substring(scriptobj, slash, scriptlen); } else { Py_INCREF(scriptobj); return(scriptobj); -- cgit v1.2.1