summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-07-26 19:15:41 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-07-26 19:16:04 +0100
commit7087de13aba5fb7303a532e198a43fd1d13435b0 (patch)
treeb4d81208ef17d05a34ff3cce0b38d1ebd75a0d56 /desktop
parentd32b179c3f2b16bb96679816db485d62ce8fe87f (diff)
avoid strncpy for windows.
Change-Id: I7949697bb245e08355a061b4548c4078bbe9a091
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx5
1 files changed, 4 insertions, 1 deletions
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 <stdio.h>
#include <string.h>
+#include <stdlib.h>
#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