From 6021e7d9acf20620c46378a5d3c49ab431a35d89 Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Thu, 22 Feb 2001 16:13:34 +0000 Subject: [PATCH] changed my last commit to use strdup() instead of moving the declaration (just like Coolo suggested) svn path=/trunk/kdebase/kwin/; revision=84000 --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 9e6f4c542c..a351d0f7ab 100644 --- a/main.cpp +++ b/main.cpp @@ -216,7 +216,6 @@ int kdemain( int argc, char * argv[] ) } } - QCString envir; if (! restored) { // we only do the multihead fork if we are not restored by the session // manager, since the session manager will register multiple kwins, @@ -241,6 +240,7 @@ int kdemain( int argc, char * argv[] ) if ((pos = display_name.findRev('.')) != -1 ) display_name.remove(pos,10); // 10 is enough to be sure we removed ".s" + QCString envir; if (number_of_screens != 1) { for (int i = 0; i < number_of_screens; i++ ) { // if execution doesn't pass by here, then kwin @@ -256,7 +256,7 @@ int kdemain( int argc, char * argv[] ) // number. If it had it, it was removed at the "pos" check envir.sprintf("DISPLAY=%s.%d", display_name.data(), kwin_screen_number); - if (putenv(envir.data())) { + if (putenv(strdup(envir.data()))) { fprintf(stderr, "%s: WARNING: unable to set DISPLAY environment variable\n", argv[0]);