desktop/source/lib/init.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 7087de13aba5fb7303a532e198a43fd1d13435b0
Author: Michael Meeks <michael.me...@suse.com>
Date:   Fri Jul 26 19:15:41 2013 +0100

    avoid strncpy for windows.
    
    Change-Id: I7949697bb245e08355a061b4548c4078bbe9a091

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d753f9a..696e413 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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to