Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
b01b3c44
Commit
b01b3c44
authored
Aug 22, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2555 from cubicdaiya/issues/reduce_strlen
Use sizeof() instead of strlen().
parents
84b24506
6c7ba826
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
+2
-2
No files found.
mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
View file @
b01b3c44
...
@@ -106,7 +106,7 @@ is_code_block_open(struct mrb_parser_state *parser)
...
@@ -106,7 +106,7 @@ is_code_block_open(struct mrb_parser_state *parser)
/* check if parser error are available */
/* check if parser error are available */
if
(
0
<
parser
->
nerr
)
{
if
(
0
<
parser
->
nerr
)
{
const
char
*
unexpected_end
=
"syntax error, unexpected $end"
;
const
char
unexpected_end
[]
=
"syntax error, unexpected $end"
;
const
char
*
message
=
parser
->
error_buffer
[
0
].
message
;
const
char
*
message
=
parser
->
error_buffer
[
0
].
message
;
/* a parser error occur, we have to check if */
/* a parser error occur, we have to check if */
...
@@ -114,7 +114,7 @@ is_code_block_open(struct mrb_parser_state *parser)
...
@@ -114,7 +114,7 @@ is_code_block_open(struct mrb_parser_state *parser)
/* a different issue which we have to show to */
/* a different issue which we have to show to */
/* the user */
/* the user */
if
(
strncmp
(
message
,
unexpected_end
,
s
trlen
(
unexpected_end
)
)
==
0
)
{
if
(
strncmp
(
message
,
unexpected_end
,
s
izeof
(
unexpected_end
)
-
1
)
==
0
)
{
code_block_open
=
TRUE
;
code_block_open
=
TRUE
;
}
}
else
if
(
strcmp
(
message
,
"syntax error, unexpected keyword_end"
)
==
0
)
{
else
if
(
strcmp
(
message
,
"syntax error, unexpected keyword_end"
)
==
0
)
{
...
...
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