aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-08-15 14:23:24 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-08-15 14:23:24 +0200
commiteab3308bd20bbcc9c6ee742362f7c31520bddf0d (patch)
tree215ad6c2140d2cf2b584450d2bdcf9439c8a819d
parent0b1041a87a8e349833ab85cda028fa6626713f83 (diff)
Revert "ignore sector math"
This reverts commit 0b1041a87a8e349833ab85cda028fa6626713f83.
-rw-r--r--src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index bcb0c1c..411d933 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -285,7 +285,9 @@ fn modify_cmdline(old: &str, new: &str) -> Result<()> {
let cmdline_offset = buf
.windows(cmdline_buf.len())
.position(|window| window == cmdline_buf)
- .ok_or(Error::NoCmdline)?;
+ .ok_or(Error::NoCmdline)?
+ / 512
+ + 1;
replace_slice(
&mut buf[cmdline_offset..cmdline_offset + cmdline_buf.len()],