-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-Return-if-there-s-actually-been-an-error.patch
37 lines (32 loc) · 1.25 KB
/
0001-Return-if-there-s-actually-been-an-error.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From b7238606c12a548dcc19ab767631e25fa97927a7 Mon Sep 17 00:00:00 2001
From: Kitlith <kitlith@kitl.pw>
Date: Fri, 15 May 2020 13:56:30 -0700
Subject: [PATCH] Return if there's actually been an error.
Used by my SAR autosplitter. TODO: is this actually necessary?
---
crates/livesplit-auto-splitting/src/environment.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/crates/livesplit-auto-splitting/src/environment.rs b/crates/livesplit-auto-splitting/src/environment.rs
index 6cbae56..eedfabf 100644
--- a/crates/livesplit-auto-splitting/src/environment.rs
+++ b/crates/livesplit-auto-splitting/src/environment.rs
@@ -158,16 +158,16 @@ impl Environment {
Ok(())
}
- pub fn read_into_buf(&mut self, address: i64, buf: i32, buf_len: i32) -> Result<(), Trap> {
+ pub fn read_into_buf(&mut self, address: i64, buf: i32, buf_len: i32) -> Result<i32, Trap> {
if let Some(process) = &self.process {
if process
.read_buf(address as u64, get_bytes(&mut self.memory, buf, buf_len)?)
.is_err()
{
- // TODO: Handle error
+ return Ok(0);
}
}
- Ok(())
+ Ok(1)
}
pub fn set_variable(
--
2.26.2