X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=bootimg.c;fp=bootimg.c;h=9ce6fb8a1021c1492bc4cba0d677f6d59f98009b;hb=629f196118682cd6f6cf5358315fc1e3d7041862;hp=77758c256650f4e683f96d4c9ca20205ab96c999;hpb=9661212ce153187c2c196006b25a2c5ad8ecf9eb;p=cascardo%2Fbootimg.git diff --git a/bootimg.c b/bootimg.c index 77758c2..9ce6fb8 100644 --- a/bootimg.c +++ b/bootimg.c @@ -48,13 +48,14 @@ static int dump(int fd, size_t len, int pgsz, char *fname) if (r != len) goto out; } + } else { + r = read(fd, page, pgsz); + if (r != pgsz) + goto out; + r = write(out, page, pgsz); + if (r != pgsz) + goto out; } - r = read(fd, page, pgsz); - if (r != pgsz) - goto out; - r = write(out, page, pgsz); - if (r != pgsz) - goto out; } free(page); close(out);