changeset 643:d51f8724acb6

Using char pointer directly from QStrings isn't ensured to work. So to be on the save side using a temporary QByteArray object. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@902 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Mon, 17 Nov 2008 13:31:59 +0000
parents 8b7c134c2de9
children d88a2df5a630
files src/SettingsPaths.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/SettingsPaths.cpp	Wed Nov 12 14:12:51 2008 +0000
+++ b/src/SettingsPaths.cpp	Mon Nov 17 13:31:59 2008 +0000
@@ -138,7 +138,8 @@
         // to an important existing file which gets overwritten when UiGUI writes
         // into this normally temporary but linked file.
         char *pathTemplate = new char[tempPath.length()+8];
-        pathTemplate = QString(tempPath + "-XXXXXX").toAscii().data();
+        QByteArray pathTemplateQBA = QString(tempPath + "-XXXXXX").toAscii();
+        pathTemplate = pathTemplateQBA.data();
         pathTemplate = mkdtemp( pathTemplate );
         tempPath = pathTemplate;
 #endif