Merge pull request #6768 from symless/issue-6342-copyright-year

SYNERGY-189 Updated copyright in cmd version to use build date
This commit is contained in:
Jnewbon 2020-09-17 10:50:23 +01:00 committed by GitHub
commit 3ad8afc77b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 3 deletions

View file

@ -5,6 +5,7 @@ Bug fixes:
- #6755 Fixed Vulnerability in vreadf function detected by Static analysis
- #6758 Account name with space on windows causes synergy to error when starting
- #6760 Synergy loses license when creating a System scope config
- #6342 Updated copyright year in version to use build date
Enhancements:
- #6750 Integrate SonarCloud for static analysis and test coverage

View file

@ -18,8 +18,9 @@
#include "common/Version.h"
const char* kBuildYear = __DATE__ + 7;
const char* kApplication = "Synergy";
const char* kCopyright = "Copyright (C) 2012-2019 Symless Ltd.\n"
const char* kCopyright = "Copyright (C) 2012-%s Symless Ltd.\n"
"Copyright (C) 2008-2014 Nick Bolton\n"
"Copyright (C) 2002-2014 Chris Schoeneman";
const char* kContact = "Email: engineering@symless.com";

View file

@ -30,6 +30,7 @@ extern const char* kApplication;
extern const char* kCopyright;
extern const char* kContact;
extern const char* kWebsite;
extern const char* kBuildYear;
// build version. follows linux kernel style: an even minor number implies
// a release version, odd implies development version.

View file

@ -83,7 +83,17 @@ App::~App()
void
App::version()
{
static const int buffer_size = 500;
static const size_t buffer_size = 500;
static const size_t cpight_size = 200;
char copyrightBuffer[cpight_size];
snprintf(
copyrightBuffer,
cpight_size,
kCopyright,
kBuildYear
);
char buffer[buffer_size];
snprintf(
buffer,
@ -93,7 +103,7 @@ App::version()
kVersion,
kProtocolMajorVersion,
kProtocolMinorVersion,
kCopyright
copyrightBuffer
);
std::cout << buffer << std::endl;