summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/truncate.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/truncate.c')
-rw-r--r--otherlibs/unix/truncate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/otherlibs/unix/truncate.c b/otherlibs/unix/truncate.c
index c5b3a1159..520320ebb 100644
--- a/otherlibs/unix/truncate.c
+++ b/otherlibs/unix/truncate.c
@@ -29,7 +29,7 @@ CAMLprim value unix_truncate(value path, value len)
CAMLparam2(path, len);
char * p;
int ret;
- p = caml_stat_alloc_string(path);
+ p = caml_strdup(String_val(path));
caml_enter_blocking_section();
ret = truncate(p, Long_val(len));
caml_leave_blocking_section();
@@ -45,7 +45,7 @@ CAMLprim value unix_truncate_64(value path, value vlen)
char * p;
int ret;
file_offset len = File_offset_val(vlen);
- p = caml_stat_alloc_string(path);
+ p = caml_strdup(String_val(path));
caml_enter_blocking_section();
ret = truncate(p, len);
caml_leave_blocking_section();