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
5e0f51c9
Unverified
Commit
5e0f51c9
authored
Jan 21, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence gcc warning from `strncpy()`.
parent
47a68e89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
+11
-6
No files found.
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
View file @
5e0f51c9
...
...
@@ -173,6 +173,7 @@ mrb_debug_set_break_line(mrb_state *mrb, mrb_debug_context *dbg, const char *fil
int32_t
index
;
char
*
set_file
;
uint16_t
result
;
size_t
len
;
if
((
mrb
==
NULL
)
||
(
dbg
==
NULL
)
||
(
file
==
NULL
))
{
return
MRB_DEBUG_INVALID_ARGUMENT
;
...
...
@@ -195,7 +196,8 @@ mrb_debug_set_break_line(mrb_state *mrb, mrb_debug_context *dbg, const char *fil
return
MRB_DEBUG_BREAK_INVALID_LINENO
;
}
set_file
=
(
char
*
)
mrb_malloc
(
mrb
,
strlen
(
file
)
+
1
);
len
=
strlen
(
file
)
+
1
;
set_file
=
(
char
*
)
mrb_malloc
(
mrb
,
len
);
index
=
dbg
->
bpnum
;
dbg
->
bp
[
index
].
bpno
=
dbg
->
next_bpno
;
...
...
@@ -205,7 +207,7 @@ mrb_debug_set_break_line(mrb_state *mrb, mrb_debug_context *dbg, const char *fil
dbg
->
bp
[
index
].
point
.
linepoint
.
lineno
=
lineno
;
dbg
->
bpnum
++
;
strncpy
(
set_file
,
file
,
strlen
(
file
)
+
1
);
strncpy
(
set_file
,
file
,
len
);
dbg
->
bp
[
index
].
point
.
linepoint
.
file
=
set_file
;
...
...
@@ -218,6 +220,7 @@ mrb_debug_set_break_method(mrb_state *mrb, mrb_debug_context *dbg, const char *c
int32_t
index
;
char
*
set_class
;
char
*
set_method
;
size_t
len
;
if
((
mrb
==
NULL
)
||
(
dbg
==
NULL
)
||
(
method_name
==
NULL
))
{
return
MRB_DEBUG_INVALID_ARGUMENT
;
...
...
@@ -232,16 +235,18 @@ mrb_debug_set_break_method(mrb_state *mrb, mrb_debug_context *dbg, const char *c
}
if
(
class_name
!=
NULL
)
{
set_class
=
(
char
*
)
mrb_malloc
(
mrb
,
strlen
(
class_name
)
+
1
);
strncpy
(
set_class
,
class_name
,
strlen
(
class_name
)
+
1
);
len
=
strlen
(
class_name
)
+
1
;
set_class
=
(
char
*
)
mrb_malloc
(
mrb
,
len
);
strncpy
(
set_class
,
class_name
,
len
);
}
else
{
set_class
=
NULL
;
}
set_method
=
(
char
*
)
mrb_malloc
(
mrb
,
strlen
(
method_name
)
+
1
);
len
=
strlen
(
method_name
)
+
1
;
set_method
=
(
char
*
)
mrb_malloc
(
mrb
,
len
);
strncpy
(
set_method
,
method_name
,
strlen
(
method_name
)
+
1
);
strncpy
(
set_method
,
method_name
,
len
);
index
=
dbg
->
bpnum
;
dbg
->
bp
[
index
].
bpno
=
dbg
->
next_bpno
;
...
...
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