summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/open.c')
-rw-r--r--otherlibs/unix/open.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/otherlibs/unix/open.c b/otherlibs/unix/open.c
index ecee01389..c98819aab 100644
--- a/otherlibs/unix/open.c
+++ b/otherlibs/unix/open.c
@@ -62,8 +62,7 @@ CAMLprim value unix_open(value path, value flags, value perm)
char * p;
cv_flags = convert_flag_list(flags, open_flag_table);
- p = caml_stat_alloc(string_length(path) + 1);
- strcpy(p, String_val(path));
+ p = caml_stat_alloc_string(path);
/* open on a named FIFO can block (PR#1533) */
enter_blocking_section();
fd = open(p, cv_flags, Int_val(perm));