@@ -287,7 +287,7 @@ static int ZSTD_initialize(void) {
287287#ifdef HAVE_ZSTD
288288 size_t const cBuffSize = ZSTD_compressBound (WRITE_BUFFSIZE );
289289 if (cBuffSize > (BUFFSIZE - sizeof (dataBlock_t ))) {
290- LogError ("LZSTD_compressBound () error in %s line %d: Buffer too small" , __FILE__ , __LINE__ );
290+ LogError ("ZSTD_compressBound () error in %s line %d: Buffer too small" , __FILE__ , __LINE__ );
291291 return 0 ;
292292 }
293293 return 1 ;
@@ -311,7 +311,7 @@ static int Compress_Block_LZO(dataBlock_t *in_block, dataBlock_t *out_block, siz
311311 r = lzo1x_1_compress (in , in_len , out , & out_len , wrkmem );
312312
313313 if (r != LZO_E_OK ) {
314- LogError ("Compress_Block_LZO() error compression failed in %s line %d: LZ0 : %d" , __FILE__ , __LINE__ , r );
314+ LogError ("Compress_Block_LZO() error compression failed in %s line %d: LZO : %d" , __FILE__ , __LINE__ , r );
315315 return -1 ;
316316 }
317317
@@ -388,11 +388,11 @@ static int Uncompress_Block_LZ4(dataBlock_t *in_block, dataBlock_t *out_block, s
388388
389389 int out_len = LZ4_decompress_safe (in , out , in_len , block_size );
390390 if (out_len == 0 ) {
391- LogError ("LZ4_decompress_safe() error compression aborted in %s line %d: LZ4 : buffer too small" , __FILE__ , __LINE__ );
391+ LogError ("LZ4_decompress_safe() error decompression aborted in %s line %d: LZ4 : buffer too small" , __FILE__ , __LINE__ );
392392 return -1 ;
393393 }
394394 if (out_len < 0 ) {
395- LogError ("LZ4_decompress_safe() error compression failed in %s line %d: LZ4 : %d" , __FILE__ , __LINE__ , out_len );
395+ LogError ("LZ4_decompress_safe() error decompression failed in %s line %d: LZ4 : %d" , __FILE__ , __LINE__ , out_len );
396396 return -1 ;
397397 }
398398
@@ -419,7 +419,7 @@ static int Compress_Block_BZ2(dataBlock_t *in_block, dataBlock_t *out_block, siz
419419 int r = BZ2_bzCompress (& bs , BZ_FINISH );
420420 if (r == BZ_FINISH_OK ) continue ;
421421 if (r != BZ_STREAM_END ) {
422- LogError ("Compress_Block_BZ2() error compression failed in %s line %d: LZ4 : %d" , __FILE__ , __LINE__ , r );
422+ LogError ("Compress_Block_BZ2() error compression failed in %s line %d: BZ2 : %d" , __FILE__ , __LINE__ , r );
423423 return -1 ;
424424 }
425425 break ;
@@ -483,7 +483,7 @@ static int Compress_Block_ZSTD(dataBlock_t *in_block, dataBlock_t *out_block, si
483483 int out_len = ZSTD_compress (out , block_size , in , in_len , level );
484484
485485 if (ZSTD_isError (out_len )) {
486- LogError ("Compress_Block_ZSTD() error compression aborted in %s line %d: LZ4 : buffer too small" , __FILE__ , __LINE__ );
486+ LogError ("Compress_Block_ZSTD() error compression aborted in %s line %d: ZSTD : buffer too small" , __FILE__ , __LINE__ );
487487 return -1 ;
488488 }
489489
@@ -506,7 +506,7 @@ static int Uncompress_Block_ZSTD(dataBlock_t *in_block, dataBlock_t *out_block,
506506
507507 size_t out_len = ZSTD_decompress (out , block_size , in , in_len );
508508 if (ZSTD_isError (out_len )) {
509- LogError ("LZ4_decompress_safe () error compression aborted in %s line %d: LZ4 : buffer too small " , __FILE__ , __LINE__ );
509+ LogError ("ZSTD_decompress () error decompression aborted in %s line %d: ZSTD : %s " , __FILE__ , __LINE__ , ZSTD_getErrorName ( out_len ) );
510510 return -1 ;
511511 }
512512
@@ -626,7 +626,7 @@ static int WriteAppendix(nffile_t *nffile) {
626626 return 0 ;
627627 }
628628
629- // set appendx info
629+ // set appendix info
630630 nffile -> file_header -> offAppendix = currentPos ;
631631 nffile -> file_header -> appendixBlocks = 1 ;
632632
@@ -698,14 +698,14 @@ static nffile_t *NewFile(uint32_t num_workers) {
698698 if (!nffile -> file_header ) {
699699 LogError ("malloc() error in %s line %d: %s" , __FILE__ , __LINE__ , strerror (errno ));
700700 free (nffile );
701- return NULL ;
701+ return NULL ; // file_header allocation failed; nffile itself is freed
702702 }
703703
704704 nffile -> stat_record = calloc (1 , sizeof (stat_record_t ));
705705 if (!nffile -> stat_record ) {
706706 LogError ("malloc() error in %s line %d: %s" , __FILE__ , __LINE__ , strerror (errno ));
707- free (nffile );
708707 free (nffile -> file_header );
708+ free (nffile );
709709 return NULL ;
710710 }
711711
@@ -715,9 +715,9 @@ static nffile_t *NewFile(uint32_t num_workers) {
715715 //
716716 nffile -> processQueue = queue_init (QueueSize );
717717 if (!nffile -> processQueue ) {
718- free (nffile );
719718 free (nffile -> file_header );
720719 free (nffile -> stat_record );
720+ free (nffile );
721721 return NULL ;
722722 }
723723
@@ -862,14 +862,14 @@ nffile_t *OpenNewFile(const char *filename, unsigned creator, unsigned compress,
862862
863863#ifndef HAVE_ZSTD
864864 if ((compress & 0xFFFF ) == ZSTD_COMPRESSED ) {
865- LogError ("OpenNewfiles : ZSTD compression not compiled in" );
865+ LogError ("OpenNewFile : ZSTD compression not compiled in" );
866866 return NULL ;
867867 }
868868#endif
869869
870870#ifndef HAVE_BZ2
871871 if ((compress & 0xFFFF ) == BZ2_COMPRESSED ) {
872- LogError ("OpenNewfiles : BZIP2 compression not compiled in" );
872+ LogError ("OpenNewFile : BZIP2 compression not compiled in" );
873873 return NULL ;
874874 }
875875#endif
@@ -1909,7 +1909,7 @@ int QueryFile(char *filename, int verbose) {
19091909 }
19101910 }
19111911 if (recordHeader -> type == SlackRecord ) {
1912- printf (" slac record" );
1912+ printf (" slack record" );
19131913 }
19141914
19151915 printf ("\n" );
@@ -2116,6 +2116,6 @@ void PrintGNUplotSumStat(nffile_t *nffile) {
21162116 printf ("%s,%llu,%llu,%llu\n" , datestr , (long long unsigned )nffile -> stat_record -> numflows , (long long unsigned )nffile -> stat_record -> numpackets ,
21172117 (long long unsigned )nffile -> stat_record -> numbytes );
21182118 } else {
2119- printf ("No datstring \n" );
2119+ printf ("No datestring \n" );
21202120 }
21212121} // End of PrintGNUplotSumStat
0 commit comments