diff --git a/lib/service/buffer.cpp b/lib/service/buffer.cpp index 14b421a..3c7064d 100644 --- a/lib/service/buffer.cpp +++ b/lib/service/buffer.cpp @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include // std::fgets_unlocked, stdin +#include // fgets_unlocked, stdin #include "../index.hpp" /** @@ -47,14 +47,13 @@ namespace comfortable_swipe::service ); // prepare data containers - static const int MAX_LINE_LENGTH = 256; - static char data[MAX_LINE_LENGTH]; + std::array line; // start reading lines from input one by one - while (fgets_unlocked(data, MAX_LINE_LENGTH, stdin) != NULL) + while (fgets_unlocked(line.data(), line.size(), stdin) != NULL) { // attempt to parse swipe gestures - swipe_gesture_handler.parse_line(data); + swipe_gesture_handler.parse_line(line.data()); } } }