int i = 0;
unsigned char symbol = 0;
- /* Contamos las frecuencias del chunk a menos que se use un canonico */
+ /* Contamos las frecuencias del chunk a menos que se use un canonico */
if (!chunkshuff->canonic) {
for (i = 0; i < chunksize; ++i) {
symbol = chunk[i];
for (i = 0; i < 256; ++i) {
if (codetable[i].codelength > 0) {
auxcode = codetable[i].code;
- printf("Symbol:%i Freq: %li Code:",i,freqtable[i]);
+ printf("Symbol:%i Freq: %lu Code:",i,freqtable[i]);
for (j = codetable[i].codelength-1; j >= 0; --j) {
auxcode = codetable[i].code;
auxcode = auxcode >> j;
SHUFFCODE symbolcode;
/* Abrimos el source y el destino */
- if (shuff->coderfp != NULL) fclose(shuff->coderfp); /* close bychunk temp file */
+ if (shuff->coderfp != NULL) {
+ fclose(shuff->coderfp); /* close bychunk temp file */
+ shuff->coderfp = NULL;
+ }
if ((fpsource = fopen(shuff->sourcefile,"r")) == NULL) return 0;
if ((fpdest = vfopen(shuff->targetfile,"w",shuff->volsize)) == NULL) return 0;