Commit a3ee43ad authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Generic Bliss account for Control Software
Browse files

Add Warning message when Command data does not fit in buffer

parent c6f26c4b
Pipeline #33673 passed with stages
in 7 minutes and 1 second
......@@ -409,6 +409,9 @@ size_t Requests::Command::_write_callback(char *ptr,size_t size,
if (cmd->check_http_response(ptr, len))
return len;
int size_to_copy = std::min(len, sizeof(m_data) - 1);
if (size_to_copy < len)
std::cout << "Requests::Command: Warning: unexpected (long) message: "
<< std::string(ptr, len) << std::endl;
cmd->m_data[size_to_copy] = '\0';
return size_to_copy;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment