mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 23:19:50 +00:00
Allow replacing the last byte in the image when using 'dfu-tool replace-data'
Fixes https://github.com/hughsie/fwupd/issues/903
This commit is contained in:
parent
8d02612893
commit
420ccd46fa
@ -480,7 +480,7 @@ dfu_tool_bytes_replace (GBytes *data, GBytes *search, GBytes *replace)
|
||||
g_return_val_if_fail (search_sz == replace_sz, FALSE);
|
||||
|
||||
/* find and replace each one */
|
||||
for (gsize i = 0; i < data_sz - search_sz; i++) {
|
||||
for (gsize i = 0; i < data_sz - search_sz + 1; i++) {
|
||||
if (memcmp (data_buf + i, search_buf, search_sz) == 0) {
|
||||
g_print ("Replacing %" G_GSIZE_FORMAT " bytes @0x%04x\n",
|
||||
replace_sz, (guint) i);
|
||||
|
Loading…
Reference in New Issue
Block a user