aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2009-10-01 06:57:31 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2009-10-01 06:57:31 (GMT)
commitc4c96ec830f7e22c5f5183886de1f399333f60cd (patch)
tree3ded4864f71f3f092697268ea879e73b8dc978e7 /src/FbCommands.cc
parent710ad1d4568239bbb1c19e82d764215b492d94db (diff)
downloadfluxbox_pavel-c4c96ec830f7e22c5f5183886de1f399333f60cd.zip
fluxbox_pavel-c4c96ec830f7e22c5f5183886de1f399333f60cd.tar.bz2
simpler code
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()));