summaryrefslogtreecommitdiffstats
path: root/byterun/dynlink.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2014-04-15 17:09:13 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2014-04-15 17:09:13 +0000
commit774e30e138dc22a5acd6cfac03ae25194ae8cd6e (patch)
tree2acda83264153258c7f978efeae08d260598c023 /byterun/dynlink.c
parent2fc7ac7e8b95a143b6b38eab28622389cc19001b (diff)
PR#6075: avoid using unsafe C library functions (strcpy, strcat, sprintf).
An ISO C99-compliant C compiler and standard library is now assumed. (Plus special exceptions for MSVC.) In particular, emulation code for 64-bit integer arithmetic was removed, the C compiler must support a 64-bit integer type. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14607 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/dynlink.c')
-rw-r--r--byterun/dynlink.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/byterun/dynlink.c b/byterun/dynlink.c
index f07cf91e3..8b4498b9d 100644
--- a/byterun/dynlink.c
+++ b/byterun/dynlink.c
@@ -79,9 +79,7 @@ static char * parse_ld_conf(void)
stdlib = getenv("OCAMLLIB");
if (stdlib == NULL) stdlib = getenv("CAMLLIB");
if (stdlib == NULL) stdlib = OCAML_STDLIB_DIR;
- ldconfname = caml_stat_alloc(strlen(stdlib) + 2 + sizeof(LD_CONF_NAME));
- strcpy(ldconfname, stdlib);
- strcat(ldconfname, "/" LD_CONF_NAME);
+ ldconfname = caml_strconcat(3, stdlib, "/", LD_CONF_NAME);
if (stat(ldconfname, &st) == -1) {
caml_stat_free(ldconfname);
return NULL;