--- embedtools/src/imgupd.c 2014/02/06 15:32:11 1.7 +++ embedtools/src/imgupd.c 2017/06/28 15:19:32 1.8 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: imgupd.c,v 1.7 2014/02/06 15:32:11 misho Exp $ + * $Id: imgupd.c,v 1.8 2017/06/28 15:19:32 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2014 +Copyright 2004 - 2017 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -129,8 +129,8 @@ EmptyStore(int img, int flg) if (wlen == -1) ESYSERR(0); else - EERROR(EIO, "Error at chunk %d init %d bytes, " - "should be %u\n", i, wlen, bufSize); + EERROR(EIO, "Error at chunk %d init %zd bytes, " + "should be %d\n", i, wlen, bufSize); return -1; } else VERB(1) printf("+Written chunk #%d\n", i); @@ -160,7 +160,7 @@ FillStore(int img, int iflg, int fd, int fflg) } else if (!rlen) break; else - VERB(1) printf("+Readed %d bytes for chunk #%d\n", rlen, j); + VERB(1) printf("+Readed %zd bytes for chunk #%d\n", rlen, j); } wlen = write(img, buf, bufSize); @@ -168,10 +168,10 @@ FillStore(int img, int iflg, int fd, int fflg) ESYSERR(0); return -1; } else if (wlen && wlen != bufSize) { - EERROR(EIO, "Error at chunk %d written %d bytes, " + EERROR(EIO, "Error at chunk %d written %zd bytes, " "should be %u\n", i, wlen, bufSize); } else - VERB(1) printf("+Written %d bytes at chunk #%d\n", wlen, i); + VERB(1) printf("+Written %zd bytes at chunk #%d\n", wlen, i); } return 0; @@ -236,7 +236,8 @@ main(int argc, char **argv) close(fd); EERROR(ENOSPC, "Error:: file size %llu is " "greater from storage size %llu\n", - iSize, imgSize); + (unsigned long long) iSize, + (unsigned long long) imgSize); return 2; } else lseek(fd, 0, SEEK_SET); @@ -269,7 +270,7 @@ main(int argc, char **argv) } VERB(1) printf("imgSize=%llu imgName=%s imgFile=%s\n", - imgSize, imgName, argc ? imgFile : ""); + (unsigned long long) imgSize, imgName, argc ? imgFile : ""); if (!m) { /* open storage device */ @@ -302,7 +303,8 @@ main(int argc, char **argv) close(img); EERROR(ENOSPC, "Error:: storage size %llu is " "greater from file size %llu\n", - iSize, imgSize); + (unsigned long long) iSize, + (unsigned long long) imgSize); return 3; } else lseek(img, 0, SEEK_SET);