diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-01-05 20:07:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-01-05 20:07:45 +0000 |
commit | 74a670128cf5739d225b8a881f549af2e83d861f (patch) | |
tree | caf9aa770f2a8543cb81cb2b05081d09fc86510c /main_common.cc | |
parent | Releasing debian version 1.20-3. (diff) | |
download | lziprecover-74a670128cf5739d225b8a881f549af2e83d861f.tar.xz lziprecover-74a670128cf5739d225b8a881f549af2e83d861f.zip |
Merging upstream version 1.21.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'main_common.cc')
-rw-r--r-- | main_common.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/main_common.cc b/main_common.cc index 3b9f677..d7a2e81 100644 --- a/main_common.cc +++ b/main_common.cc @@ -1,5 +1,5 @@ /* Lziprecover - Data recovery tool for the lzip format - Copyright (C) 2009-2018 Antonio Diaz Diaz. + Copyright (C) 2009-2019 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,8 +17,7 @@ namespace { -const char * const program_year = "2018"; - +const char * const program_year = "2019"; void show_version() { @@ -65,7 +64,7 @@ long long getnum( const char * const ptr, const int hardbs, case 'k': if( tail[0] != 'i' ) exponent = 1; break; case 'B': case 's': usuf = *p; exponent = 0; break; - default : if( tailp ) { tail = p; exponent = 0; } break; + default : if( tailp ) { tail = p; exponent = 0; } } if( exponent > 1 && tail[0] == 'i' ) { ++tail; factor = 1024; } if( exponent > 0 && usuf == 0 && ( tail[0] == 'B' || tail[0] == 's' ) ) @@ -104,11 +103,9 @@ void show_error( const char * const msg, const int errcode, const bool help ) { if( verbosity < 0 ) return; if( msg && msg[0] ) - { - std::fprintf( stderr, "%s: %s", program_name, msg ); - if( errcode > 0 ) std::fprintf( stderr, ": %s", std::strerror( errcode ) ); - std::fputc( '\n', stderr ); - } + std::fprintf( stderr, "%s: %s%s%s\n", program_name, msg, + ( errcode > 0 ) ? ": " : "", + ( errcode > 0 ) ? std::strerror( errcode ) : "" ); if( help ) std::fprintf( stderr, "Try '%s --help' for more information.\n", invocation_name ); |