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
4854f21c
Commit
4854f21c
authored
Sep 05, 2012
by
Masaki Muranaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some redundant memset().
parent
75da9954
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
tools/mirb/mirb.c
tools/mirb/mirb.c
+6
-7
No files found.
tools/mirb/mirb.c
View file @
4854f21c
...
...
@@ -143,7 +143,9 @@ print_cmdline(int code_block_open)
int
main
(
void
)
{
char
last_char
,
ruby_code
[
1024
],
last_code_line
[
1024
];
char
last_char
;
char
ruby_code
[
1024
]
=
{
0
};
char
last_code_line
[
1024
]
=
{
0
};
int
char_index
;
mrbc_context
*
cxt
;
struct
mrb_parser_state
*
parser
;
...
...
@@ -163,8 +165,6 @@ main(void)
cxt
=
mrbc_context_new
(
mrb
);
cxt
->
capture_errors
=
1
;
memset
(
ruby_code
,
0
,
sizeof
(
*
ruby_code
));
memset
(
last_code_line
,
0
,
sizeof
(
*
last_code_line
));
while
(
TRUE
)
{
print_cmdline
(
code_block_open
);
...
...
@@ -197,8 +197,7 @@ main(void)
strcat
(
ruby_code
,
last_code_line
);
}
else
{
memset
(
ruby_code
,
0
,
sizeof
(
*
ruby_code
));
strcat
(
ruby_code
,
last_code_line
);
strcpy
(
ruby_code
,
last_code_line
);
}
}
...
...
@@ -238,8 +237,8 @@ main(void)
p
(
mrb
,
result
);
}
}
memset
(
ruby_code
,
0
,
sizeof
(
*
ruby_code
))
;
memset
(
last_code_line
,
0
,
sizeof
(
*
last_code_line
))
;
ruby_code
[
0
]
=
'\0'
;
last_code_line
[
0
]
=
'\0'
;
mrb_parser_free
(
parser
);
}
}
...
...
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