The previous code incorrectly assumed that the buffer from curl is a zero-terminated string.
This issue was almost never noticeable, because I guess in practice both buffers start out zero-initialized. One case where it was noticeable: when the server dynamically changes the status message to a shorter message, the client displayed garbage characters from the previous (longer) message at the end.
The previous code incorrectly assumed that the buffer from curl is a zero-terminated string.
This issue was almost never noticeable, because I guess in practice both buffers start out zero-initialized. One case where it was noticeable: when the server dynamically changes the status message to a shorter message, the client displayed garbage characters from the previous (longer) message at the end.