Update 'sk2a/compressor.c'

This commit is contained in:
Damián Korpesio 2022-01-20 08:24:29 +00:00
parent 30da46a2ee
commit 3d00dc9176

View File

@ -235,13 +235,13 @@ int mylz78decompress(char* buff,int size,char** outbuf){
words[index][strlen(words[number])] = c; words[index][strlen(words[number])] = c;
// ak nam nebude stacit miesto v *outbuf, treba allocovat viac // ak nam nebude stacit miesto v *outbuf, treba allocovat viac
while((strlen(words[index]) + pos) > (size - 1)){ /*while((strlen(words[index]) + pos) > (size - 1)){
size *= 2; size *= 2;
char *tempbuf = calloc(size,sizeof(char)); char *tempbuf = calloc(size,sizeof(char));
memset(tempbuf,'\0',size); memset(tempbuf,'\0',size);
strcpy(tempbuf,*outbuf); strcpy(tempbuf,*outbuf);
*outbuf = tempbuf; *outbuf = tempbuf;
} }*/
strcpy(*outbuf + pos,words[index]); strcpy(*outbuf + pos,words[index]);
pos += strlen(words[index]); pos += strlen(words[index]);