summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-10-04 10:27:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-10-04 14:23:16 +0200
commit22c1d6972b4dbf2a3394a28cacfb27cf5bdbb659 (patch)
treef2cf59829316fe3ff92ce397ac27ecf0b09a6fa6 /soltools
parent3d4012a84c13448d1320f1e42ccb72de6bb9a480 (diff)
Avoid -Werror=stringop-truncation
... "‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length", as reported at <https://lists.freedesktop.org/archives/libreoffice/2018-October/081109.html> "LO build fails -Werror=stringop-truncation in _lex.c". Not adding the terminating NUL appears to be intentional here, as the s->inp buffer is terminated (through s->inl) with EOB bytes after the if/else blocks. Change-Id: I5a8559e620b7e34ee27cbcd0f836432deb8cba90 Reviewed-on: https://gerrit.libreoffice.org/61355 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'soltools')
-rw-r--r--soltools/cpp/_lex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index 3fa180b040a4..70c808b87187 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -668,7 +668,7 @@ Source *
len = strlen(str);
s->inb = domalloc(len + 4);
s->inp = s->inb;
- strncpy((char *) s->inp, str, len);
+ memcpy((char *) s->inp, str, len);
}
else
{