X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=tools%2Ffirmware-utils%2Fsrc%2Fimagetag.c;h=e93f5f45e8081e59ea9d778a972fe1bb779bcc28;hb=1c49507d8045ed5da217fa78efc5c74cb807ee30;hp=bd62b203390cb221d3759e30cd7504c039c9e948;hpb=d7ff5b45f6ee7c3355f2b67680069b64dbe06119;p=openwrt-github%2F.git diff --git a/tools/firmware-utils/src/imagetag.c b/tools/firmware-utils/src/imagetag.c index bd62b20339..e93f5f45e8 100644 --- a/tools/firmware-utils/src/imagetag.c +++ b/tools/firmware-utils/src/imagetag.c @@ -219,6 +219,10 @@ int tagfile(const char *kernel, const char *rootfs, const char *bin, fseek(binfile, rootfsoff + rootfslen - fwaddr, SEEK_SET); fwrite(&deadcode, sizeof(uint32_t), 1, binfile); + /* Flush the binfile buffer so that when we read from file, it contains + * everything in the buffer + */ + fflush(binfile); /* Choose and compute the CRC32 that should be inserted in the tag */ if ( tagid && ( (strncmp(tagid, "bccfe", TAGID_LEN) == 0)) || ( strncmp(tagid, "bc300", TAGID_LEN) == 0)) {