summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-09 15:28:09 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-09 15:28:09 +0000
commit72ebd85559e82b2accce6b24b3307845859f0497 (patch)
treea9adce412f90c1f8ef2e68f6180ae24cbc4d6538
parent660e1dca5df2df0ae4a893a43bce1d6154231fd2 (diff)
append_str don't look the length of string
* mjit.c (compile_c_to_so): use append_str2() and pass the length of so_name. append_str() uses the size of the 2nd argument, not the length of it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--mjit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mjit.c b/mjit.c
index 4b8ea2e08d..561ff8304d 100644
--- a/mjit.c
+++ b/mjit.c
@@ -686,13 +686,15 @@ compile_c_to_so(const char *c_file, const char *so_file)
char **args;
#ifdef _MSC_VER
char *p;
+ int solen;
#endif
input[0] = c_file;
#ifdef _MSC_VER
- p = (char *)output[0] = xmalloc(3 + strlen(so_file) + 1);
+ solen = strlen(so_file);
+ p = (char *)output[0] = xmalloc(3 + solen + 1);
p = append_str(p, "-Fe");
- p = append_str(p, so_file);
+ p = append_str2(p, so_file, solen);
*p = '\0';
args = form_args(4, (mjit_opts.debug ? VC_COMMON_ARGS_DEBUG : VC_COMMON_ARGS),
output, input, libs);