From a85998af7c44c047cb4e35cfa8373330e3f45088 Mon Sep 17 00:00:00 2001 From: Alexandre Vassalotti Date: Sat, 3 May 2008 18:24:43 +0000 Subject: Issue #1950: Fixed misusage of PyUnicode_AsString(). --- Modules/datetimemodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Modules/datetimemodule.c') diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c index 711adba12e..e64b230a43 100644 --- a/Modules/datetimemodule.c +++ b/Modules/datetimemodule.c @@ -1217,10 +1217,9 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple, assert(object && format && timetuple); assert(PyUnicode_Check(format)); /* Convert the input format to a C string and size */ - pin = PyUnicode_AsString(format); + pin = PyUnicode_AsStringAndSize(format, &flen); if (!pin) return NULL; - flen = PyUnicode_GetSize(format); /* Give up if the year is before 1900. * Python strftime() plays games with the year, and different -- cgit v1.2.1