diff Modules/python.c @ 65412:3794c9b50824

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.
author Victor Stinner <victor.stinner@haypocalc.com>
date Sat, 16 Oct 2010 23:16:16 +0000
parents 49df778889e6
children 45079ad1e260
line wrap: on
line diff
--- a/Modules/python.c	Sat Oct 16 22:55:47 2010 +0000
+++ b/Modules/python.c	Sat Oct 16 23:16:16 2010 +0000
@@ -41,7 +41,7 @@
     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];