summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-16 17:08:23 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-16 17:08:23 (GMT)
commit5a3ff79fd6b885726a1c7d999975ff1ecb35225c (patch)
treee47f0c560d0ec0696c0f07b7f7faa79743d36846 /Modules
parentde49d64dbcfb108e79a0e42f983ebc2df07219a0 (diff)
downloadcpython-5a3ff79fd6b885726a1c7d999975ff1ecb35225c.zip
cpython-5a3ff79fd6b885726a1c7d999975ff1ecb35225c.tar.gz
cpython-5a3ff79fd6b885726a1c7d999975ff1ecb35225c.tar.bz2
Issue #10653: Fix time.strftime() on Windows, check for invalid format strings
Diffstat (limited to 'Modules')
-rw-r--r--Modules/timemodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index f825c2c..b7604b0 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -463,16 +463,16 @@ time_strftime(PyObject *self, PyObject *args)
fmt = PyBytes_AS_STRING(format);
#endif
-#if defined(MS_WINDOWS) && defined(HAVE_WCSFTIME)
+#if defined(MS_WINDOWS)
/* check that the format string contains only valid directives */
- for(outbuf = wcschr(fmt, L'%');
+ for(outbuf = strchr(fmt, '%');
outbuf != NULL;
- outbuf = wcschr(outbuf+2, L'%'))
+ outbuf = strchr(outbuf+2, '%'))
{
if (outbuf[1]=='#')
++outbuf; /* not documented by python, */
if (outbuf[1]=='\0' ||
- !wcschr(L"aAbBcdHIjmMpSUwWxXyYzZ%", outbuf[1]))
+ !strchr("aAbBcdHIjmMpSUwWxXyYzZ%", outbuf[1]))
{
PyErr_SetString(PyExc_ValueError, "Invalid format string");
return 0;