Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 136ea49

Browse files
author
Victor Stinner
committed
Issue #10951: Fix a compiler warning in timemodule.c
1 parent e5b2ac8 commit 136ea49

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Modules/timemodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,18 @@ time_strftime(PyObject *self, PyObject *args)
527527
* will be ahead of time...
528528
*/
529529
for (i = 1024; ; i += i) {
530+
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
530531
int err;
532+
#endif
531533
outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char));
532534
if (outbuf == NULL) {
533535
PyErr_NoMemory();
534536
break;
535537
}
536538
buflen = format_time(outbuf, i, fmt, &buf);
539+
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
537540
err = errno;
541+
#endif
538542
if (buflen > 0 || i >= 256 * fmtlen) {
539543
/* If the buffer is 256 times as long as the format,
540544
it's probably not failing for lack of room!

0 commit comments

Comments
 (0)