From ffb237628c9b16d1f1e22bf9832012b6a4a81d2b Mon Sep 17 00:00:00 2001 From: Niclas Antti Date: Mon, 27 Jul 2020 10:42:38 +0300 Subject: [PATCH] fix GCC 10 warnings --- maxutils/maxbase/include/maxbase/stopwatch.hh | 2 +- server/core/secrets.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maxutils/maxbase/include/maxbase/stopwatch.hh b/maxutils/maxbase/include/maxbase/stopwatch.hh index fcd08400f..e7ae9d8c1 100644 --- a/maxutils/maxbase/include/maxbase/stopwatch.hh +++ b/maxutils/maxbase/include/maxbase/stopwatch.hh @@ -60,7 +60,7 @@ struct Duration : public Clock::duration * * A std::chrono::time_point to go with Clock and Duration. */ -using TimePoint = std::chrono::time_point; +using TimePoint = std::chrono::steady_clock::time_point; /** * @class StopWatch diff --git a/server/core/secrets.cc b/server/core/secrets.cc index facc54f27..6a8140edc 100644 --- a/server/core/secrets.cc +++ b/server/core/secrets.cc @@ -56,7 +56,7 @@ static int secrets_random_str(unsigned char* output, int len) static MAXKEYS* secrets_readKeys(const char* path) { static const char NAME[] = ".secrets"; - char secret_file[PATH_MAX + 1 + sizeof(NAME)]; // Worst case: maximum path + "/" + name. + char secret_file[PATH_MAX + 1 + sizeof(NAME) + 1]; // Worst case: maximum path + "/" + name+ '\0' MAXKEYS* keys; struct stat secret_stats; static int reported = 0; @@ -256,7 +256,7 @@ int secrets_write_keys(const char* dir) return 1; } - snprintf(secret_file, PATH_MAX + 9, "%s/.secrets", dir); + snprintf(secret_file, PATH_MAX + 10, "%s/.secrets", dir); clean_up_pathname(secret_file); /* Open for writing | Create | Truncate the file for writing */