X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/64c023294fb2524bbb2a0839732a7f4e48cd6f5f..943fc97fb0340c01d8039bccbfc6c90ddcffc774:/package/mtd/src/mtd.c?ds=sidebyside diff --git a/package/mtd/src/mtd.c b/package/mtd/src/mtd.c index 3e84fd696..be4c1be7f 100644 --- a/package/mtd/src/mtd.c +++ b/package/mtd/src/mtd.c @@ -18,7 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id$ * * The code is based on the linux-mtd examples. */ @@ -276,10 +275,8 @@ mtd_write(int imagefd, const char *mtd) } } - if (r == 0) { - fprintf(stderr, "No more data left\n"); + if (r == 0) break; - } buflen += r; } while (buflen < erasesize); @@ -288,7 +285,7 @@ mtd_write(int imagefd, const char *mtd) break; if (jffs2file) { - if (memcmp(buf, JFFS2_EOF, sizeof(JFFS2_EOF)) == 0) { + if (memcmp(buf, JFFS2_EOF, sizeof(JFFS2_EOF) - 1) == 0) { if (!quiet) fprintf(stderr, "\b\b\b "); if (quiet < 2)