mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Fixed broken conversion
This commit is contained in:
@@ -334,7 +334,11 @@ public:
|
||||
if (get_payload_size() == 0) {
|
||||
return close::status::NO_STATUS;
|
||||
} else if (get_payload_size() >= 2) {
|
||||
uint16_t code = ntohs(reinterpret_cast<uint16_t>(m_payload[1]) | reinterpret_cast<uint16_t>(m_payload[0]) << 8);
|
||||
char val[2] = { m_payload[0], m_payload[1] };
|
||||
uint16_t code;
|
||||
|
||||
memcpy(&code, val, sizeof(code));
|
||||
code = ntohs(code);
|
||||
|
||||
return close::status::value(code);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user