avoid strncpy for windows.

Change-Id: I7949697bb245e08355a061b4548c4078bbe9a091
This commit is contained in:
Michael Meeks
2013-07-26 19:16:04 +01:00
parent d32b179c3f
commit 7087de13ab
+4 -1
View File
@@ -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