0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 07:31:03 +08:00

Problem: unnecessary copying of string literals

Solution: just copy the address
This commit is contained in:
Simon Giesecke 2019-12-11 13:01:26 +01:00 committed by Simon Giesecke
parent 4c3f115469
commit 2256bd5b0b

View File

@ -118,14 +118,14 @@ zmq::ws_engine_t::~ws_engine_t ()
void zmq::ws_engine_t::start_ws_handshake ()
{
if (_client) {
char protocol[21];
const char *protocol;
if (_options.mechanism == ZMQ_NULL)
strcpy (protocol, "ZWS2.0/NULL,ZWS2.0");
protocol = "ZWS2.0/NULL,ZWS2.0";
else if (_options.mechanism == ZMQ_PLAIN)
strcpy (protocol, "ZWS2.0/PLAIN");
protocol = "ZWS2.0/PLAIN";
#ifdef ZMQ_HAVE_CURVE
else if (_options.mechanism == ZMQ_CURVE)
strcpy (protocol, "ZWS2.0/CURVE");
protocol = "ZWS2.0/CURVE";
#endif
else
assert (false);