Skip to content

Commit

Permalink
Prevent trailing zero byte
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Salikhov committed Jun 27, 2019
1 parent 21cd552 commit 2d2253d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ where
native_error: result.native_error,
message_length,
message,
message_string: unsafe { ::environment::OS_ENCODING.decode(&message[0..(message_length as usize + 1)]).0.into_owned()},
message_string: unsafe {
::environment::OS_ENCODING.decode(&message[0..message_length as usize]).0.into_owned()
},
})
}
NoData(()) => None,
Expand Down

0 comments on commit 2d2253d

Please sign in to comment.