aboutsummaryrefslogtreecommitdiff
path: root/works/life/computer-network-experiment/Common.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-06-07 20:33:23 +0800
committercrupest <crupest@outlook.com>2021-06-07 20:33:23 +0800
commit2bc323cfa5d317188da591413bce7f1230e383b4 (patch)
treefa7c70a0012c17d376191642c31261d3bb5513b7 /works/life/computer-network-experiment/Common.cpp
parentc10e08c3896343cc7ddffe1dd7b1d09da2f8548e (diff)
downloadcrupest-2bc323cfa5d317188da591413bce7f1230e383b4.tar.gz
crupest-2bc323cfa5d317188da591413bce7f1230e383b4.tar.bz2
crupest-2bc323cfa5d317188da591413bce7f1230e383b4.zip
import(life): ...
Diffstat (limited to 'works/life/computer-network-experiment/Common.cpp')
-rw-r--r--works/life/computer-network-experiment/Common.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/works/life/computer-network-experiment/Common.cpp b/works/life/computer-network-experiment/Common.cpp
index 22f8b63..e4615fc 100644
--- a/works/life/computer-network-experiment/Common.cpp
+++ b/works/life/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;