diff options
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r-- | src/FbCommands.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 3c69386..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())); |
@@ -466,7 +463,7 @@ void SetResourceValueDialogCmd::execute() { | |||
466 | 463 | ||
467 | FbTk::FbWindow *win = new CommandDialog(*screen, "Type resource name and the value", "SetResourceValue "); | 464 | FbTk::FbWindow *win = new CommandDialog(*screen, "Type resource name and the value", "SetResourceValue "); |
468 | win->show(); | 465 | win->show(); |
469 | }; | 466 | } |
470 | 467 | ||
471 | REGISTER_UNTRUSTED_COMMAND_WITH_ARGS(bindkey, FbCommands::BindKeyCmd, void); | 468 | REGISTER_UNTRUSTED_COMMAND_WITH_ARGS(bindkey, FbCommands::BindKeyCmd, void); |
472 | 469 | ||