summaryrefslogtreecommitdiffhomepage
path: root/src/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file.c')
-rw-r--r--src/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/file.c b/src/file.c
index ae643abac..f90204585 100644
--- a/src/file.c
+++ b/src/file.c
@@ -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;