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
ed1100f3
Commit
ed1100f3
authored
Oct 20, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use sscanf(s, "%x", &c) to parse \xX... escapes; hardcode it.
parent
f6a84db0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
Python/compile.c
Python/compile.c
+10
-3
No files found.
Python/compile.c
View file @
ed1100f3
...
...
@@ -36,7 +36,6 @@ PERFORMANCE OF THIS SOFTWARE.
XXX (it's currently the first item of the co_const tuple)
XXX Generate simple jump for break/return outside 'try...finally'
XXX Allow 'continue' inside try-finally
XXX New 1-byte opcode for loading None
XXX New opcode for loading the initial index for a for loop
XXX other JAR tricks?
*/
...
...
@@ -922,11 +921,19 @@ parsestr(s)
break
;
case
'x'
:
if
(
isxdigit
(
Py_CHARMASK
(
*
s
)))
{
sscanf
(
s
,
"%x"
,
&
c
);
*
p
++
=
c
;
unsigned
int
x
=
0
;
do
{
c
=
Py_CHARMASK
(
*
s
);
s
++
;
x
=
(
x
<<
4
)
&
~
0xF
;
if
(
isdigit
(
c
))
x
+=
c
-
'0'
;
else
if
(
islower
(
c
))
x
+=
10
+
c
-
'a'
;
else
x
+=
10
+
c
-
'A'
;
}
while
(
isxdigit
(
Py_CHARMASK
(
*
s
)));
*
p
++
=
x
;
break
;
}
/* FALLTHROUGH */
...
...
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