From b9e3bc8f446683653417c61af37790acb57d4976 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Thu, 25 Apr 2019 16:53:50 +0930 Subject: [PATCH] adjust debug output to show when compression is ineffective. --- src/compress_text.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/compress_text.c b/src/compress_text.c index cbde0ada..9f9f2392 100644 --- a/src/compress_text.c +++ b/src/compress_text.c @@ -392,14 +392,29 @@ int main(void) fprintf(stderr,"$%03X : ",i); int old_offset=packed_len; pack_word(words[i],packed_words,&packed_len); - fprintf(stderr," Packing word: "); - for(int j=old_offset;j=strlen(words[i])) { + if ((packed_len-old_offset)>strlen(words[i])) + fprintf(stderr," Packed word '%s' longer than original: ",words[i]); + else + fprintf(stderr," Packed word '%s' no smaller than original: ",words[i]); + for(int j=old_offset;j=strlen(keyword_list[i])) { + if ((packedkey_len-old_offset)>strlen(keyword_list[i])) + fprintf(stderr," Packed word '%s' longer than original: ",keyword_list[i]); + else + fprintf(stderr," Packed word '%s' no smaller than original: ",keyword_list[i]); + for(int j=old_offset;j