summaryrefslogtreecommitdiff
path: root/Modules/datetimemodule.c
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-05-03 18:24:43 +0000
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-05-03 18:24:43 +0000
commita85998af7c44c047cb4e35cfa8373330e3f45088 (patch)
tree4f8af4d5cd63bb592f4504b729916a3cf8bb9285 /Modules/datetimemodule.c
parent999679a23ec5731d32dbdbf04b61d4ebb4bcd476 (diff)
downloadcpython-git-a85998af7c44c047cb4e35cfa8373330e3f45088.tar.gz
Issue #1950: Fixed misusage of PyUnicode_AsString().
Diffstat (limited to 'Modules/datetimemodule.c')
-rw-r--r--Modules/datetimemodule.c3
1 files changed, 1 insertions, 2 deletions
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