diff options
| author | Akira Yumiyama <[email protected]> | 2013-05-12 14:01:53 +0900 |
|---|---|---|
| committer | Akira Yumiyama <[email protected]> | 2013-05-12 14:01:53 +0900 |
| commit | 49cc9c7cfa55f4aa11fc1ce39539429e97e536b4 (patch) | |
| tree | c90d81a8412fafd2b8f9aa5a9a10877a3ea22696 /src/file.c | |
| parent | c25d386c419546c31ecf8ae09fb3aeb15d511469 (diff) | |
| download | mruby-49cc9c7cfa55f4aa11fc1ce39539429e97e536b4.tar.gz mruby-49cc9c7cfa55f4aa11fc1ce39539429e97e536b4.zip | |
Use strncpy instead of strcpy.
Diffstat (limited to 'src/file.c')
| -rw-r--r-- | src/file.c | 2 |
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; |
