From 4fde43407f37561bfd1f95ca4e7093ad82a78760 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Wed, 7 May 2014 17:56:53 +0000 Subject: [PATCH] Eradicate one more sprintf(). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14763 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- asmrun/natdynlink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asmrun/natdynlink.c b/asmrun/natdynlink.c index edb389dbb..053594c8f 100644 --- a/asmrun/natdynlink.c +++ b/asmrun/natdynlink.c @@ -25,9 +25,8 @@ #include static void *getsym(void *handle, char *module, char *name){ - char *fullname = malloc(strlen(module) + strlen(name) + 5); + char *fullname = caml_strconcat(3, "caml", module, name); void *sym; - sprintf(fullname, "caml%s%s", module, name); sym = caml_dlsym (handle, fullname); /* printf("%s => %lx\n", fullname, (uintnat) sym); */ free(fullname);