From 7087de13aba5fb7303a532e198a43fd1d13435b0 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 26 Jul 2013 19:15:41 +0100 Subject: avoid strncpy for windows. Change-Id: I7949697bb245e08355a061b4548c4078bbe9a091 --- desktop/source/lib/init.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d753f9a33ed6..696e413b1866 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -9,6 +9,7 @@ #include #include +#include #include "liblibreoffice.hxx" @@ -141,7 +142,9 @@ bool LibLODocument_Impl::saveAs (const char *url) char *LibLibreOffice_Impl::getError() { OString aStr = rtl::OUStringToOString( maLastExceptionMsg, RTL_TEXTENCODING_UTF8 ); - return strndup( aStr.getStr(), aStr.getLength() ); + char *pMem = (char *) malloc (aStr.getLength() + 1); + strcpy( pMem, aStr.getStr() ); + return pMem; } static void -- cgit