stdlib: Implement ivec::unsafe::set_len

This commit is contained in:
Patrick Walton
2011-07-11 17:26:34 -07:00
parent d21228fce7
commit 3275cad6d5
3 changed files with 22 additions and 5 deletions

View File

@@ -63,7 +63,7 @@ obj FILE_buf_reader(os::libc::FILE f, bool must_close) {
auto buf = ~[];
ivec::reserve[u8](buf, len);
auto read = os::libc_ivec::fread(ivec::to_ptr[u8](buf), 1u, len, f);
ivec::len_set[u8](buf, read);
ivec::unsafe::set_len[u8](buf, read);
ret buf;
}
fn read_byte() -> int { ret os::libc::fgetc(f); }