static const char *title =\
"Broadcom Consumer Router Firmware Header Editor"
;
-static const float VERSION = 1.2f;
+static const float VERSION = 1.3f;
static const char *copyright = \
"Copyright 2015-2016 TJ <hacker@iam.tj>\n"
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,