From 49cc9c7cfa55f4aa11fc1ce39539429e97e536b4 Mon Sep 17 00:00:00 2001 From: Akira Yumiyama Date: Sun, 12 May 2013 14:01:53 +0900 Subject: Use strncpy instead of strcpy. --- src/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3