Skip to content

Commit 09e911b

Browse files
committed
---
yaml --- r: 11979 b: refs/heads/master c: 1a40aa0 h: refs/heads/master i: 11977: 6960cf8 11975: 5a5c065 v: v3
1 parent 030f668 commit 09e911b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 13ae8e0626da4c808e98595fcaeb9689b47d01df
2+
refs/heads/master: 1a40aa0935357cbfc8bba6e7b0fd7c5461c9732e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn fill_charp_buf(f: fn(*mutable c_char, size_t) -> bool)
6565
-> option<str> {
6666
let buf = vec::to_mut(vec::from_elem(tmpbuf_sz, 0u8 as c_char));
6767
vec::as_mut_buf(buf) { |b|
68-
if f(b, tmpbuf_sz as size_t) {
68+
if f(b, tmpbuf_sz as size_t) unsafe {
6969
some(str::from_buf(b as *u8))
7070
} else {
7171
none

trunk/src/libcore/str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn from_chars(chs: [char]) -> str {
186186
}
187187

188188
#[doc = "Create a Rust string from a null-terminated *u8 buffer"]
189-
fn from_buf(buf: *u8) -> str unsafe {
189+
unsafe fn from_buf(buf: *u8) -> str {
190190
let mut curr = buf, i = 0u;
191191
while *curr != 0u8 {
192192
i += 1u;
@@ -196,12 +196,12 @@ fn from_buf(buf: *u8) -> str unsafe {
196196
}
197197

198198
#[doc = "Create a Rust string from a null-terminated C string"]
199-
fn from_c_str(c_str: *libc::c_char) -> str unsafe {
199+
unsafe fn from_c_str(c_str: *libc::c_char) -> str {
200200
from_buf(::unsafe::reinterpret_cast(c_str))
201201
}
202202

203203
#[doc = "Create a Rust string from a *u8 buffer of the given length"]
204-
fn from_buf_len(buf: *u8, len: uint) -> str unsafe {
204+
unsafe fn from_buf_len(buf: *u8, len: uint) -> str {
205205
let mut v: [u8] = [];
206206
vec::reserve(v, len + 1u);
207207
vec::as_buf(v) {|b| ptr::memcpy(b, buf, len); }
@@ -215,7 +215,7 @@ fn from_buf_len(buf: *u8, len: uint) -> str unsafe {
215215
}
216216

217217
#[doc = "Create a Rust string from a `*c_char` buffer of the given length"]
218-
fn from_c_str_len(c_str: *libc::c_char, len: uint) -> str unsafe {
218+
unsafe fn from_c_str_len(c_str: *libc::c_char, len: uint) -> str {
219219
from_buf_len(::unsafe::reinterpret_cast(c_str), len)
220220
}
221221

0 commit comments

Comments
 (0)