Mercurial > hg > dmlib
changeset 88:aa9fbdbcea70
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 02 Oct 2012 14:25:47 +0300 |
parents | baf72a99d5ee |
children | b10884934aca |
files | jloadxm.c |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/jloadxm.c Tue Oct 02 10:50:44 2012 +0300 +++ b/jloadxm.c Tue Oct 02 14:25:47 2012 +0300 @@ -581,7 +581,7 @@ remainder = xmI1.headSize - (dmftell(inFile) - pos); if (remainder > 0) { - JSSDEBUG("PPM! Skipping: %li\n", remainder); + JSSDEBUG("Skipping: %li\n", remainder); dmfseek(inFile, remainder, SEEK_CUR); } } @@ -722,7 +722,7 @@ */ for (index = 0; index < module->npatterns; index++) { - off_t pos; + off_t pos, remainder; XMPattern xmP; // Get the pattern header @@ -757,9 +757,11 @@ } // Skip extra data (if the file is damaged) - if (xmP.size > dmftell(inFile) - pos) + remainder = xmP.headSize - (dmftell(inFile) - pos); + if (remainder > 0) { - dmfseek(inFile, dmftell(inFile) - pos, SEEK_CUR); + JSSDEBUG("Skipping: %li\n", remainder); + dmfseek(inFile, remainder, SEEK_CUR); } }