diff --git a/maxutils/maxbase/include/maxbase/stopwatch.hh b/maxutils/maxbase/include/maxbase/stopwatch.hh index b9a7a4ef1..eabb0f4ba 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 c19b3c54b..209135f61 100644 --- a/server/core/secrets.cc +++ b/server/core/secrets.cc @@ -55,7 +55,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; @@ -255,7 +255,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 */