Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6e7a827e
Commit
6e7a827e
authored
Sep 23, 2016
by
Christian Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an extra byte for null in case we ever get very long unicode names.
parent
e0c4a6ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Modules/unicodedata.c
Modules/unicodedata.c
+4
-4
No files found.
Modules/unicodedata.c
View file @
6e7a827e
...
...
@@ -1041,8 +1041,8 @@ _cmpname(PyObject *self, int code, const char* name, int namelen)
{
/* check if code corresponds to the given name */
int
i
;
char
buffer
[
NAME_MAXLEN
];
if
(
!
_getucname
(
self
,
code
,
buffer
,
sizeof
(
buffer
)
,
1
))
char
buffer
[
NAME_MAXLEN
+
1
];
if
(
!
_getucname
(
self
,
code
,
buffer
,
NAME_MAXLEN
,
1
))
return
0
;
for
(
i
=
0
;
i
<
namelen
;
i
++
)
{
if
(
Py_TOUPPER
(
Py_CHARMASK
(
name
[
i
]))
!=
buffer
[
i
])
...
...
@@ -1195,10 +1195,10 @@ static PyObject *
unicodedata_UCD_name_impl
(
PyObject
*
self
,
int
chr
,
PyObject
*
default_value
)
/*[clinic end generated code: output=6bbb37a326407707 input=3e0367f534de56d9]*/
{
char
name
[
NAME_MAXLEN
];
char
name
[
NAME_MAXLEN
+
1
];
Py_UCS4
c
=
(
Py_UCS4
)
chr
;
if
(
!
_getucname
(
self
,
c
,
name
,
sizeof
(
name
)
,
0
))
{
if
(
!
_getucname
(
self
,
c
,
name
,
NAME_MAXLEN
,
0
))
{
if
(
default_value
==
NULL
)
{
PyErr_SetString
(
PyExc_ValueError
,
"no such name"
);
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment