mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Use strncpy instead of strcpy.
This commit is contained in:
+1
-1
@@ -259,7 +259,7 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
|
||||
}
|
||||
|
||||
result = mrb_str_buf_new(mrb, strlen(home));
|
||||
strcpy( RSTRING_PTR(result), home);
|
||||
strncpy(RSTRING_PTR(result), home, strlen(home));
|
||||
mrb_str_resize(mrb, result, strlen(RSTRING_PTR(result)));
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user