summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-02-10 20:06:08 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2018-02-10 20:06:08 +0000
commit38e3d2dff7982736f1e6833e06d4aab4652f337a (patch)
tree62acedcdca7d6d1e5d99165b5dbe4c50d7cce2b3 /src
parent5df85ea74169c9d1b8c058416e36b3e33b39f4ea (diff)
Compiler-quietening
Diffstat (limited to 'src')
-rw-r--r--src/src/exim.c2
-rw-r--r--src/src/macro.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index 3f1e153fd..38e1a56b6 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -1432,7 +1432,7 @@ if (isupper(big_buffer[0]))
if (macro_read_assignment(big_buffer))
{
uschar * s = Ustrchr(big_buffer, '=');
- printf("Defined macro '%.*s'\n", s - big_buffer, big_buffer);
+ printf("Defined macro '%.*s'\n", (int)(s - big_buffer), big_buffer);
}
}
else
diff --git a/src/src/macro.c b/src/src/macro.c
index 82c1ec717..56a70880c 100644
--- a/src/src/macro.c
+++ b/src/src/macro.c
@@ -40,7 +40,11 @@ m->namelen = namelen;
m->replen = Ustrlen(val);
m->m_number = m_number++;
memset(&m->tnode, 0, sizeof(tree_node));
-Ustrcpy(m->tnode.name, name);
+/* Use memcpy here not Ustrcpy to avoid spurious compiler-inserted check
+when building with fortify-source. We know there is room for the copy into
+this dummy for a variable-size array because of the way we did the memory
+allocation above. */
+memcpy(m->tnode.name, name, namelen+1);
m->tnode.data.ptr = string_copyn(val, m->replen);
(void) tree_insertnode(&tree_macros, &m->tnode);