diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Ice/Service.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index da91bb24c85..7b0c658a6ba 100644 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -1274,17 +1274,15 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[]) // Don't need to pass a wide string converter in the bellow argv conversions // as argv come from Windows API. // + assert(argc == 1); char** args = new char*[_serviceArgs.size() + argc]; - args[0] = const_cast<char*>(wstringToString(argv[0], converter).c_str()); + const string serviceName = wstringToString(argv[0], converter); + args[0] = const_cast<char*>(serviceName.c_str()); int i = 1; for(vector<string>::iterator p = _serviceArgs.begin(); p != _serviceArgs.end(); ++p) { args[i++] = const_cast<char*>(p->c_str()); } - for(int j = 1; j < argc; ++j) - { - args[i++] = const_cast<char*>(wstringToString(argv[j], converter).c_str()); - } argc += static_cast<int>(_serviceArgs.size()); // |