diff ui/tests/cinstprocesstest.cpp @ 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 17e1c8f37d72
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/