Browse Source

Merge pull request #11 from panicbit/fix/console

Fix Console fmt::Write impl
pull/10/head
Ronald Kinard 8 years ago committed by GitHub
parent
commit
545196e1ad
  1. 4
      src/console.rs

4
src/console.rs

@ -35,6 +35,10 @@ impl Default for Console { @@ -35,6 +35,10 @@ impl Default for Console {
impl Write for Console {
fn write_str(&mut self, s: &str) -> fmt::Result {
// Writing 0 bytes to the console fails
if s.is_empty() {
return Ok(())
}
unsafe { consoleSelect(&mut self.context); }
let ret = unsafe { libc::write(libc::STDOUT_FILENO, s.as_ptr() as *const _, s.len()) };
if ret == s.len() as isize {

Loading…
Cancel
Save