From 22c1d6972b4dbf2a3394a28cacfb27cf5bdbb659 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 4 Oct 2018 10:27:54 +0200 Subject: Avoid -Werror=stringop-truncation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... "‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length", as reported at "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 --- soltools/cpp/_lex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'soltools') 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 { -- cgit