changing zmq_proxy_steerable to not use null terminated strings

This commit is contained in:
Brian Knox
2013-12-01 20:29:03 +00:00
parent 0f6e737ff8
commit ff292d62d0
2 changed files with 7 additions and 7 deletions

View File

@@ -114,13 +114,13 @@ int zmq::proxy (
if (unlikely (rc < 0))
return -1;
}
if (msg.size () == 6 && memcmp (msg.data (), "PAUSE", 6) == 0)
if (msg.size () == 5 && memcmp (msg.data (), "PAUSE", 5) == 0)
state = paused;
else
if (msg.size () == 7 && memcmp (msg.data (), "RESUME", 7) == 0)
if (msg.size () == 6 && memcmp (msg.data (), "RESUME", 6) == 0)
state = active;
else
if (msg.size () == 10 && memcmp (msg.data (), "TERMINATE", 10) == 0)
if (msg.size () == 9 && memcmp (msg.data (), "TERMINATE", 9) == 0)
state = terminated;
else {
// This is an API error, we should assert