Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanity check in get_shader_info_log #22

Merged
merged 1 commit into from Apr 21, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Avoid calling truncate with a invalid size if result_len is 0

  • Loading branch information
csherratt committed Apr 20, 2013
commit b31b96be1ee2bb7c31b17ae1bde21a927c4a693d
4 gl2.rs
@@ -654,7 +654,7 @@ pub fn get_program_info_log(program: GLuint) -> ~str {
1024 as GLsizei,
to_unsafe_ptr(&result_len),
to_ptr(result) as *GLchar);
result.truncate((result_len - 1)as uint);
result.truncate(if result_len > 0 {result_len-1} else {0} as uint);
return from_bytes(result);
}
}
@@ -675,7 +675,7 @@ pub fn get_shader_info_log(shader: GLuint) -> ~str {
1024 as GLsizei,
to_unsafe_ptr(&result_len),
to_ptr(result) as *GLchar);
result.truncate((result_len - 1)as uint);
result.truncate(if result_len > 0 {result_len-1} else {0} as uint);
return from_bytes(result);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.