summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-12-17 21:39:43 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-12-17 21:39:43 (GMT)
commitab870218e341724aaf983df9e6e7a425edcbd88b (patch)
tree76095f085464fd842caed7a648c484d079920295 /Modules/timemodule.c
parent0ba5af20c049bc4c38002c108a1838f27cd793d8 (diff)
parent136ea49b3990d4ed1600be0d042c3676cfcece0f (diff)
downloadcpython-ab870218e341724aaf983df9e6e7a425edcbd88b.zip
cpython-ab870218e341724aaf983df9e6e7a425edcbd88b.tar.gz
cpython-ab870218e341724aaf983df9e6e7a425edcbd88b.tar.bz2
Issue #10951: Fix compiler warnings in timemodule.c and unicodeobject.c
Thanks Jérémy Anger for the fix.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index ad28e58..89a41ce 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -515,14 +515,18 @@ time_strftime(PyObject *self, PyObject *args)
* will be ahead of time...
*/
for (i = 1024; ; i += i) {
+#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
int err;
+#endif
outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char));
if (outbuf == NULL) {
PyErr_NoMemory();
break;
}
buflen = format_time(outbuf, i, fmt, &buf);
+#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
err = errno;
+#endif
if (buflen > 0 || i >= 256 * fmtlen) {
/* If the buffer is 256 times as long as the format,
it's probably not failing for lack of room!