Permalink
Browse files

also work when offset is not 0.

  • Loading branch information...
1 parent 3de9ed0 commit 9642b5e6ed3e39ff5cc3e926d9f1ddda940f6cff Romain Slootmaekers committed Jun 1, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/baardskeerder_util.c
View
@@ -14,10 +14,10 @@ value Caml_set_size_unsafe(value v_buf, value v_size){
value Caml_size_from_unsafe(value v_buf, value v_pos){
CAMLparam2(v_buf,v_pos);
- char * buf = String_val(v_buf);
+ char* buf = String_val(v_buf);
int pos = Long_val(v_pos);
- int * ibuf = (int*) buf;
- int size = ibuf[pos];
+ int* where = (int*) &buf[pos];
+ int size = * where;
value v_size = Val_long(size);
CAMLreturn(v_size);
}

0 comments on commit 9642b5e

Please sign in to comment.