diff options
author | crupest <crupest@outlook.com> | 2021-06-07 20:33:23 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-07 20:33:23 +0800 |
commit | 45ea1ec04953380ea50e346ba0f1b2eeda0c2dd3 (patch) | |
tree | 6f68641a7edbf2a20c8a62fb6207a10052206f4e /computer-network-experiment/Common.cpp | |
parent | bc0e9b6558b7737846699c41196433055f915aec (diff) | |
download | life-45ea1ec04953380ea50e346ba0f1b2eeda0c2dd3.tar.gz life-45ea1ec04953380ea50e346ba0f1b2eeda0c2dd3.tar.bz2 life-45ea1ec04953380ea50e346ba0f1b2eeda0c2dd3.zip |
...
Diffstat (limited to 'computer-network-experiment/Common.cpp')
-rw-r--r-- | computer-network-experiment/Common.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/computer-network-experiment/Common.cpp b/computer-network-experiment/Common.cpp index 22f8b63..e4615fc 100644 --- a/computer-network-experiment/Common.cpp +++ b/computer-network-experiment/Common.cpp @@ -116,7 +116,7 @@ std::string SafeReadUntil(int socket, char c, std::string &rest) { bool b = false;
for (int i = 0; i < received_number; i++) {
- if (buffer[i] == '\n') {
+ if (buffer[i] == c) {
result.append(buffer, i);
rest = std::string(buffer + i + 1, received_number - i - 1);
b = true;
|