diff --git a/src/lib/barrier/ClientApp.cpp b/src/lib/barrier/ClientApp.cpp index 6986245a..ca9ac4ce 100644 --- a/src/lib/barrier/ClientApp.cpp +++ b/src/lib/barrier/ClientApp.cpp @@ -59,6 +59,7 @@ #include #include +#include #define RETRY_TIME 1.0 @@ -119,35 +120,25 @@ ClientApp::help() # define WINAPI_INFO #endif - char buffer[2000]; - sprintf( - buffer, - "Start the barrier client and connect to a remote server component.\n" - "\n" - "Usage: %s" - " [--yscroll ]" - WINAPI_ARG - HELP_SYS_ARGS - HELP_COMMON_ARGS - " " - "\n\n" - "Options:\n" - HELP_COMMON_INFO_1 - WINAPI_INFO - HELP_SYS_INFO - " --yscroll defines the vertical scrolling delta, which is\n" - " 120 by default.\n" - HELP_COMMON_INFO_2 - "\n" - "Default options are marked with a *\n" - "\n" - "The server address is of the form: [][:]. The hostname\n" - "must be the address or hostname of the server. The port overrides the\n" - "default port, %d.\n", - args().m_pname, kDefaultPort - ); + std::ostringstream buffer; + buffer << "Start the barrier client and connect to a remote server component." << std::endl + << std::endl + << "Usage: " << args().m_pname << " [--yscroll ]" << WINAPI_ARG << HELP_SYS_ARGS + << HELP_COMMON_ARGS << " " << std::endl + << std::endl + << "Options:" << std::endl + << HELP_COMMON_INFO_1 << WINAPI_INFO << HELP_SYS_INFO + << " --yscroll defines the vertical scrolling delta, which is" << std::endl + << " 120 by default." << std::endl + << HELP_COMMON_INFO_2 + << std::endl + << "Default options are marked with a *" << std::endl + << std::endl + << "The server address is of the form: [][:]. The hostname" << std::endl + << "must be the address or hostname of the server. The port overrides the" << std::endl + << "default port, " << kDefaultPort << "." << std::endl; - LOG((CLOG_PRINT "%s", buffer)); + LOG((CLOG_PRINT "%s", buffer.str().c_str())); } const char* diff --git a/src/lib/barrier/ServerApp.cpp b/src/lib/barrier/ServerApp.cpp index eb520cac..b9df07cb 100644 --- a/src/lib/barrier/ServerApp.cpp +++ b/src/lib/barrier/ServerApp.cpp @@ -59,6 +59,7 @@ #include #include #include +#include // // ServerApp @@ -120,43 +121,31 @@ ServerApp::help() # define WINAPI_INFO #endif - char buffer[3000]; - sprintf( - buffer, - "Start the barrier server component.\n" - "\n" - "Usage: %s" - " [--address
]" - " [--config ]" - WINAPI_ARGS - HELP_SYS_ARGS - HELP_COMMON_ARGS - "\n\n" - "Options:\n" - " -a, --address
listen for clients on the given address.\n" - " -c, --config use the named configuration file instead.\n" - HELP_COMMON_INFO_1 - WINAPI_INFO - HELP_SYS_INFO - HELP_COMMON_INFO_2 - "\n" - "Default options are marked with a *\n" - "\n" - "The argument for --address is of the form: [][:]. The\n" - "hostname must be the address or hostname of an interface on the system.\n" - "The default is to listen on all interfaces. The port overrides the\n" - "default port, %d.\n" - "\n" - "If no configuration file pathname is provided then the first of the\n" - "following to load successfully sets the configuration:\n" - " $HOME/%s\n" - " %s\n", - args().m_pname, kDefaultPort, - USR_CONFIG_NAME, - ARCH->concatPath(ARCH->getSystemDirectory(), SYS_CONFIG_NAME).c_str() - ); + std::ostringstream buffer; + buffer << "Start the barrier server component." << std::endl + << std::endl + << "Usage: " << args().m_pname + << " [--address
]" + << " [--config ]" + << WINAPI_ARGS << HELP_SYS_ARGS << HELP_COMMON_ARGS << std::endl + << std::endl + << "Options:" << std::endl + << " -a, --address
listen for clients on the given address." << std::endl + << " -c, --config use the named configuration file instead." << std::endl + << HELP_COMMON_INFO_1 << WINAPI_INFO << HELP_SYS_INFO << HELP_COMMON_INFO_2 << std::endl + << "Default options are marked with a *" << std::endl + << std::endl + << "The argument for --address is of the form: [][:]. The" << std::endl + << "hostname must be the address or hostname of an interface on the system." << std::endl + << "The default is to listen on all interfaces. The port overrides the" << std::endl + << "default port, " << kDefaultPort << "." << std::endl + << std::endl + << "If no configuration file pathname is provided then the first of the" << std::endl + << "following to load successfully sets the configuration:" << std::endl + << " $HOME/" << USR_CONFIG_NAME << std::endl + << " " << ARCH->concatPath(ARCH->getSystemDirectory(), SYS_CONFIG_NAME) << std::endl; - LOG((CLOG_PRINT "%s", buffer)); + LOG((CLOG_PRINT "%s", buffer.str().c_str())); } void