Skip to content

Commit

Permalink
Error checking fix for ClipboardUtil::set_clipboard_text
Browse files Browse the repository at this point in the history
SDL_SetClipboardText returns 0 on success, not failure.  Before this
fix, calling set_clipboard_text successfully would generally return
Err("").
  • Loading branch information
kyren authored and Cobrand committed Dec 12, 2017
1 parent 2bed801 commit 871700e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sdl2/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl ClipboardUtil {
let text = CString::new(text).unwrap();
let result = sys::SDL_SetClipboardText(text.as_ptr() as *const c_char);

if result == 0 {
if result != 0 {
Err(get_error())
} else {
Ok(())
Expand Down

0 comments on commit 871700e

Please sign in to comment.