all: misc updates

This commit is contained in:
Markus F.X.J. Oberhumer
2023-05-13 16:28:44 +02:00
parent 279101d464
commit b3e4efbabe
7 changed files with 23 additions and 25 deletions
+2 -2
View File
@@ -407,7 +407,7 @@ void show_version(bool one_line) {
fprintf(fp, "Copyright (C) 2000-2023 John F. Reiser\n");
fprintf(fp, "Copyright (C) 2002-2023 Jens Medoch\n");
#if (WITH_ZLIB)
fprintf(fp, "Copyright (C) 1995" "-2022 Jean-loup Gailly and Mark Adler\n");
fprintf(fp, "Copyright (C) 1995" "-2023 Jean-loup Gailly and Mark Adler\n");
#endif
#if (WITH_LZMA)
fprintf(fp, "Copyright (C) 1999" "-2006 Igor Pavlov\n");
@@ -417,7 +417,7 @@ void show_version(bool one_line) {
fprintf(fp, "Copyright (C) 2015" "-2023 Meta Platforms, Inc. and affiliates\n");
#endif
#if !defined(DOCTEST_CONFIG_DISABLE)
fprintf(fp, "Copyright (C) 2016" "-2021 Viktor Kirilov\n");
fprintf(fp, "Copyright (C) 2016" "-2023 Viktor Kirilov\n");
#endif
fprintf(fp, "UPX comes with ABSOLUTELY NO WARRANTY; for details type '%s -L'.\n", progname);
// clang-format on
+4 -8
View File
@@ -298,9 +298,9 @@ static char *prepare_shortopts(char *buf, const char *n, const struct mfx_option
template <class T>
static int getoptvar(T *var, const T min_value, const T max_value, const char *arg_fatal) {
const char *p = mfx_optarg;
char *endptr;
char *endptr = nullptr;
int r = 0;
long n;
long long n;
T v;
if (!p || !p[0]) {
@@ -310,20 +310,16 @@ static int getoptvar(T *var, const T min_value, const T max_value, const char *a
// avoid interpretation as octal value
while (p[0] == '0' && isdigit(p[1]))
p++;
n = strtol(p, &endptr, 0);
n = strtoll(p, &endptr, 0);
if (*endptr != '\0') {
r = -2;
goto error;
}
v = (T) n;
if (v < min_value) {
if ((long long) v != n || v < min_value || v > max_value) {
r = -3;
goto error;
}
if (v > max_value) {
r = -4;
goto error;
}
*var = v;
goto done;
error:
+1 -5
View File
@@ -26,8 +26,6 @@
*/
#pragma once
#ifndef UPX_PACKER_H__
#define UPX_PACKER_H__ 1
#include "util/membuffer.h"
@@ -102,7 +100,7 @@ bool ph_testOverlappingDecompression(const PackHeader &ph, SPAN_P(const byte) bu
/*************************************************************************
// abstract base class for packers
//
// FIXME: this class is way too fat and badly needs a decomposition
// FIXME later: this class is way too fat and badly needs a decomposition
**************************************************************************/
class Packer {
@@ -362,6 +360,4 @@ int force_method(int method); // (0x80ul<<24)|method
int forced_method(int method); // (0x80ul<<24)|method ==> method
int is_forced_method(int method); // predicate
#endif /* already included */
/* vim:set ts=4 sw=4 et: */