projects
/
firmware_header_edit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7140203
)
Fix write length so it includes the updated header (tag) CRC32
master
author
TJ
<hacker@iam.tj>
Mon, 17 Oct 2016 00:51:14 +0000
(
01:51
+0100)
committer
TJ
<hacker@iam.tj>
Mon, 17 Oct 2016 00:51:14 +0000
(
01:51
+0100)
Signed-off-by: TJ <hacker@iam.tj>
firmware_header_editor.c
patch
|
blob
|
history
diff --git
a/firmware_header_editor.c
b/firmware_header_editor.c
index
b41f45d
..
ca0e24b
100644
(file)
--- a/
firmware_header_editor.c
+++ b/
firmware_header_editor.c
@@
-324,8
+324,9
@@
main(int argc, char **argv)
memcpy(buffer + header_crc_offset, &tmp, sizeof(tmp));
if (!opt_simulate) {
+ ssize_t write_len = header_len > header_crc_offset + sizeof(tmp) ? header_len : header_crc_offset + sizeof(tmp);
lseek(fd, 0, SEEK_SET);
- write(fd, buffer,
header
_len);
+ write(fd, buffer,
write
_len);
}
printf( format_spec,