summaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 26a431a..f050669 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -144,7 +144,6 @@ int ExecuteCmd::run() {
144 144
145 string displaystring("DISPLAY="); 145 string displaystring("DISPLAY=");
146 displaystring += DisplayString(FbTk::App::instance()->display()); 146 displaystring += DisplayString(FbTk::App::instance()->display());
147 char intbuff[64];
148 int screen_num = m_screen_num; 147 int screen_num = m_screen_num;
149 if (screen_num < 0) { 148 if (screen_num < 0) {
150 if (Fluxbox::instance()->mouseScreen() == 0) 149 if (Fluxbox::instance()->mouseScreen() == 0)
@@ -153,8 +152,6 @@ int ExecuteCmd::run() {
153 screen_num = Fluxbox::instance()->mouseScreen()->screenNumber(); 152 screen_num = Fluxbox::instance()->mouseScreen()->screenNumber();
154 } 153 }
155 154
156 sprintf(intbuff, "%d", screen_num);
157
158 // get shell path from the environment 155 // get shell path from the environment
159 // this process exits immediately, so we don't have to worry about memleaks 156 // this process exits immediately, so we don't have to worry about memleaks
160 const char *shell = getenv("SHELL"); 157 const char *shell = getenv("SHELL");
@@ -163,7 +160,7 @@ int ExecuteCmd::run() {
163 160
164 // remove last number of display and add screen num 161 // remove last number of display and add screen num
165 displaystring.erase(displaystring.size()-1); 162 displaystring.erase(displaystring.size()-1);
166 displaystring += intbuff; 163 displaystring += FbTk::StringUtil::number2String(screen_num);
167 164
168 setsid(); 165 setsid();
169 putenv(const_cast<char *>(displaystring.c_str())); 166 putenv(const_cast<char *>(displaystring.c_str()));