Kaydet (Commit) 136ea49b authored tarafından Victor Stinner's avatar Victor Stinner

Issue #10951: Fix a compiler warning in timemodule.c

üst e5b2ac89
...@@ -527,14 +527,18 @@ time_strftime(PyObject *self, PyObject *args) ...@@ -527,14 +527,18 @@ time_strftime(PyObject *self, PyObject *args)
* will be ahead of time... * will be ahead of time...
*/ */
for (i = 1024; ; i += i) { for (i = 1024; ; i += i) {
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
int err; int err;
#endif
outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char)); outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char));
if (outbuf == NULL) { if (outbuf == NULL) {
PyErr_NoMemory(); PyErr_NoMemory();
break; break;
} }
buflen = format_time(outbuf, i, fmt, &buf); buflen = format_time(outbuf, i, fmt, &buf);
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
err = errno; err = errno;
#endif
if (buflen > 0 || i >= 256 * fmtlen) { if (buflen > 0 || i >= 256 * fmtlen) {
/* If the buffer is 256 times as long as the format, /* If the buffer is 256 times as long as the format,
it's probably not failing for lack of room! it's probably not failing for lack of room!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment