--- embedtools/src/imgupd.c 2014/02/06 00:16:05 1.6.2.2 +++ embedtools/src/imgupd.c 2014/02/06 00:56:16 1.6.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: imgupd.c,v 1.6.2.2 2014/02/06 00:16:05 misho Exp $ + * $Id: imgupd.c,v 1.6.2.3 2014/02/06 00:56:16 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -123,13 +123,13 @@ FillStore(int img, int fd) else VERB(1) printf("+Readed %d bytes for chunk #%d\n", rlen, j); - wlen = write(img, buf, rlen); + wlen = write(img, buf, bufSize); if (wlen == -1) { ESYSERR(0); return -1; - } else if (wlen && wlen != rlen) { - EERROR(EIO, "Readed %d bytes are not equal to written %d bytes\n", - rlen, wlen); + } else if (wlen && wlen != bufSize) { + EERROR(EIO, "Error at chunk %d written %d bytes, " + "should be %u\n", i, wlen, bufSize); } else VERB(1) printf("+Written %d bytes at chunk #%d\n", wlen, i); }