summaryrefslogtreecommitdiffstats
path: root/common_decode.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:43:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:43:28 +0000
commite0c798fd4f336deba0ac88c5f71418dda624bd2e (patch)
tree220a8f28beadbd5b80a0c6d7c1155eb842e77a99 /common_decode.cc
parentAdding upstream version 0.19. (diff)
downloadtarlz-e0c798fd4f336deba0ac88c5f71418dda624bd2e.tar.xz
tarlz-e0c798fd4f336deba0ac88c5f71418dda624bd2e.zip
Adding upstream version 0.21.upstream/0.21
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'common_decode.cc')
-rw-r--r--common_decode.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/common_decode.cc b/common_decode.cc
index 6ff3086..595fd7b 100644
--- a/common_decode.cc
+++ b/common_decode.cc
@@ -18,19 +18,13 @@
#define _FILE_OFFSET_BITS 64
#include <cerrno>
-#include <climits>
#include <cstdio>
#include <cstdlib>
-#include <cstring>
#include <ctime>
-#include <string>
-#include <vector>
-#include <pthread.h> // for tarlz.h
-#include <stdint.h>
#include <sys/stat.h>
-#include "arg_parser.h"
#include "tarlz.h"
+#include "arg_parser.h"
namespace {
@@ -146,7 +140,7 @@ bool format_member_name( const Extended & extended, const Tar_header header,
else
offset += snprintf( rbuf() + offset, rbuf.size() - offset, " %9llu",
extended.file_size() );
- for( int i = 0; i < 2; ++i )
+ for( int i = 0; i < 2; ++i ) // resize rbuf if not large enough
{
const int len = snprintf( rbuf() + offset, rbuf.size() - offset,
" %4d-%02u-%02u %02u:%02u %s%s%s\n",
@@ -186,7 +180,7 @@ bool check_skip_filename( const Cl_options & cl_opts,
const char * const filename )
{
if( Exclude::excluded( filename ) ) return true; // skip excluded files
- bool skip = cl_opts.filenames > 0;
+ bool skip = cl_opts.num_files > 0;
if( skip )
for( int i = 0; i < cl_opts.parser.arguments(); ++i )
if( nonempty_arg( cl_opts.parser, i ) )