changeset 314:5e4ae994a320

Make buffer size for fakeHome environment variable dynamic. %TMP% can get ridicoulously long on windows.
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 04 Apr 2014 11:05:44 +0000
parents f17226aa2e09
children 43416dcbcc50
files ui/tests/cinstprocesstest.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ui/tests/cinstprocesstest.cpp	Fri Apr 04 11:02:02 2014 +0000
+++ b/ui/tests/cinstprocesstest.cpp	Fri Apr 04 11:05:44 2014 +0000
@@ -103,8 +103,9 @@
  * see nsstest for the real test of that code */
 #ifdef WIN32
     {
-        char buf[255];
-        snprintf(buf, 255, "APPDATA=%s",fakeHome.path().toLocal8Bit().constData());
+        char buf[fakeHome.path().toLocal8Bit().size() + 9];
+        snprintf(buf, fakeHome.path().toLocal8Bit().size() + 9,
+                "APPDATA=%s",fakeHome.path().toLocal8Bit().constData());
         QVERIFY(_putenv (buf) != -1);
     }
 #else

http://wald.intevation.org/projects/trustbridge/