auto merge of #9281 : brson/rust/multistring, r=alexcrichton

When `count` is `Some` this function was reading a byte past the end
of the buffer.
This commit is contained in:
bors 2013-09-17 22:20:57 -07:00
commit cbd1eefbd3
1 changed files with 2 additions and 2 deletions

View File

@ -1107,8 +1107,8 @@ pub mod raw {
Some(limit) => (true, limit),
None => (false, 0)
};
while(*(curr_ptr as *libc::c_char) != 0 as libc::c_char
&& ((limited_count && ctr < limit) || !limited_count)) {
while(((limited_count && ctr < limit) || !limited_count)
&& *(curr_ptr as *libc::c_char) != 0 as libc::c_char) {
let env_pair = from_c_str(
curr_ptr as *libc::c_char);
result.push(env_pair);