summaryrefslogtreecommitdiffstats
path: root/Modules/python.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-16 23:16:16 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-16 23:16:16 (GMT)
commit168e117e0a8825bc3ae0c08f0b08a33ac351a14f (patch)
tree8f9e0067a2d14a362844f891815791d9d41cfb79 /Modules/python.c
parent0a1b8cba90d467e85be87cd8b10b4d31caa8765a (diff)
downloadcpython-168e117e0a8825bc3ae0c08f0b08a33ac351a14f.zip
cpython-168e117e0a8825bc3ae0c08f0b08a33ac351a14f.tar.gz
cpython-168e117e0a8825bc3ae0c08f0b08a33ac351a14f.tar.bz2
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.
Diffstat (limited to 'Modules/python.c')
-rw-r--r--Modules/python.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/python.c b/Modules/python.c
index 9a71cd0..47685a4 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];