From 168e117e0a8825bc3ae0c08f0b08a33ac351a14f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 16 Oct 2010 23:16:16 +0000 Subject: Add an optional size argument to _Py_char2wchar() _Py_char2wchar() callers usually need the result size in characters. Since it's trivial to compute it in _Py_char2wchar() (O(1) whereas wcslen() is O(n)), add an option to get it. --- Modules/python.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/python.c') diff --git a/Modules/python.c b/Modules/python.c index 9a71cd06da..47685a419a 100644 --- a/Modules/python.c +++ b/Modules/python.c @@ -41,7 +41,7 @@ main(int argc, char **argv) oldloc = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, ""); for (i = 0; i < argc; i++) { - argv_copy[i] = _Py_char2wchar(argv[i]); + argv_copy[i] = _Py_char2wchar(argv[i], NULL); if (!argv_copy[i]) return 1; argv_copy2[i] = argv_copy[i]; -- cgit v1.2.1