From 0f22f0178cdfd27e2bac47388fb710023d9f4494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 5 Aug 2020 20:17:56 -0300 Subject: Fix line lengths not sent properly --- src/client/jetc.cpp | 2 +- src/common/ipc.cpp | 4 ---- src/server/client.cpp | 2 +- src/server/point.cpp | 5 +---- 4 files changed, 3 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/client/jetc.cpp b/src/client/jetc.cpp index 94d59ac..8a0963d 100644 --- a/src/client/jetc.cpp +++ b/src/client/jetc.cpp @@ -20,7 +20,7 @@ void update() { msg.encode2(window.height); io.send(msg); io.recv(window.view, window.width * window.height); - io.recv(window.line_ends, window.height); + io.recv(window.line_ends, window.height * sizeof(int)); window.update(); cursor.update(); diff --git a/src/common/ipc.cpp b/src/common/ipc.cpp index 261b31f..5ad809f 100644 --- a/src/common/ipc.cpp +++ b/src/common/ipc.cpp @@ -17,10 +17,6 @@ struct Message { uint8_t data[MESSAGE_SIZE] = {}; int offset = 0; - bool at_end() { - return data[offset] == 0; - } - void encode1(int8_t input) { data[offset++] = input; } diff --git a/src/server/client.cpp b/src/server/client.cpp index 7932436..a2579ab 100644 --- a/src/server/client.cpp +++ b/src/server/client.cpp @@ -76,7 +76,7 @@ struct Client { } io.send(view, window_w * window_h); - io.send(line_ends, window_h); + io.send(line_ends, window_h * sizeof(int)); delete[] view; delete[] line_ends; } diff --git a/src/server/point.cpp b/src/server/point.cpp index cf38bed..5b87d44 100644 --- a/src/server/point.cpp +++ b/src/server/point.cpp @@ -1,7 +1,7 @@ #include #include -class Point { +struct Point { Page *page; uint16_t index; @@ -55,9 +55,6 @@ class Point { } } - - public: - Point() : page(0), index(0) {} Point(Page* page, uint16_t index) : page(page), index(index) {} Point(const Buffer &b) : page(b.storage), index(0) {} -- cgit v1.2.3