Skip to content
Snippets Groups Projects
Commit 2cda534d authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add fixes for -Wformat-security warnings (seems to be enabled on Ubuntu).

This doesn't allow non-string literals as formats, these may include format specifiers and can cause buffer overruns, maybe.
parent 97241530
No related branches found
No related tags found
2 merge requests!136Master,!69Add fixes for -Wformat-security warnings.
......@@ -37,9 +37,9 @@ const char *git_revision(void) {
static const char *revision = GIT_REVISION;
if(!initialised) {
if(strlen(revision) == 0)
sprintf(buf, "Unknown");
sprintf(buf, "%s", "unknown");
else
sprintf(buf, revision);
sprintf(buf, "%s", revision);
initialised = 1;
}
return buf;
......@@ -56,9 +56,9 @@ const char *git_branch(void) {
static const char *branch = GIT_BRANCH;
if(!initialised) {
if(strlen(branch) == 0)
sprintf(buf, "Unknown");
sprintf(buf, "%s", "unknown");
else
sprintf(buf, branch);
sprintf(buf, "%s", branch);
initialised = 1;
}
return buf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment