Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
da1b579c
Commit
da1b579c
authored
1 year ago
by
Alam Ed Arias
Browse files
Options
Downloads
Patches
Plain Diff
Tokenizer_Open: pad the string with an NULL byte
parent
8c7fe2ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!2363
Tokenizer mem
,
!2355
fix newer versions of mixerx
Pipeline
#2662
failed
1 year ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/m_tokenizer.c
+3
-1
3 additions, 1 deletion
src/m_tokenizer.c
src/m_tokenizer.h
+1
-1
1 addition, 1 deletion
src/m_tokenizer.h
with
4 additions
and
2 deletions
src/m_tokenizer.c
+
3
−
1
View file @
da1b579c
...
...
@@ -15,8 +15,10 @@
tokenizer_t
*
Tokenizer_Open
(
const
char
*
inputString
,
size_t
len
,
unsigned
numTokens
)
{
tokenizer_t
*
tokenizer
=
Z_Malloc
(
sizeof
(
tokenizer_t
),
PU_STATIC
,
NULL
);
const
size_t
lenpan
=
len
+
1
;
tokenizer
->
zdup
=
malloc
(
len
);
tokenizer
->
zdup
=
malloc
(
lenpan
);
tokenizer
->
zdup
[
len
]
=
0x00
;
tokenizer
->
input
=
M_Memcpy
(
tokenizer
->
zdup
,
inputString
,
len
);
tokenizer
->
startPos
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/m_tokenizer.h
+
1
−
1
View file @
da1b579c
...
...
@@ -16,7 +16,7 @@
typedef
struct
Tokenizer
{
void
*
zdup
;
char
*
zdup
;
const
char
*
input
;
unsigned
numTokens
;
UINT32
*
capacity
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment