summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-02-26 04:48:01 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2015-02-26 04:48:01 (GMT)
commitf63dab5a842df7349af73be23fb3acc37aa75703 (patch)
tree1bb0e65096caacc588b21ea5c2539a5147f2a5a4 /Modules/main.c
parentb3f51e3c449585a1396f17df9d5db224ba3e0e0a (diff)
downloadcpython-f63dab5a842df7349af73be23fb3acc37aa75703.zip
cpython-f63dab5a842df7349af73be23fb3acc37aa75703.tar.gz
cpython-f63dab5a842df7349af73be23fb3acc37aa75703.tar.bz2
Back-out wcstok deprecation suppression and updates calls to use wcstok_s.
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 83538c4..74e512b 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -520,16 +520,16 @@ Py_Main(int argc, wchar_t **argv)
#ifdef MS_WINDOWS
if (!Py_IgnoreEnvironmentFlag && (wp = _wgetenv(L"PYTHONWARNINGS")) &&
*wp != L'\0') {
- wchar_t *buf, *warning;
+ wchar_t *buf, *warning, *context = NULL;
buf = (wchar_t *)PyMem_RawMalloc((wcslen(wp) + 1) * sizeof(wchar_t));
if (buf == NULL)
Py_FatalError(
"not enough memory to copy PYTHONWARNINGS");
wcscpy(buf, wp);
- for (warning = wcstok(buf, L",");
+ for (warning = wcstok_s(buf, L",", &context);
warning != NULL;
- warning = wcstok(NULL, L",")) {
+ warning = wcstok_s(NULL, L",", &context)) {
PySys_AddWarnOption(warning);
}
PyMem_RawFree(buf);