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
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment