summaryrefslogtreecommitdiffhomepage
path: root/src/file.c
diff options
context:
space:
mode:
authorAkira Yumiyama <[email protected]>2013-05-12 14:01:53 +0900
committerAkira Yumiyama <[email protected]>2013-05-12 14:01:53 +0900
commit49cc9c7cfa55f4aa11fc1ce39539429e97e536b4 (patch)
treec90d81a8412fafd2b8f9aa5a9a10877a3ea22696 /src/file.c
parentc25d386c419546c31ecf8ae09fb3aeb15d511469 (diff)
downloadmruby-49cc9c7cfa55f4aa11fc1ce39539429e97e536b4.tar.gz
mruby-49cc9c7cfa55f4aa11fc1ce39539429e97e536b4.zip
Use strncpy instead of strcpy.
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;