diff --git a/src/add-ons/kernel/drivers/tty/tty.cpp b/src/add-ons/kernel/drivers/tty/tty.cpp index 3957ab0d1e..563d6a7dbe 100644 --- a/src/add-ons/kernel/drivers/tty/tty.cpp +++ b/src/add-ons/kernel/drivers/tty/tty.cpp @@ -1851,7 +1851,8 @@ tty_input_read(tty_cookie* cookie, void* _buffer, size_t* _length) buffer += bytesRead; length -= bytesRead; *_length += bytesRead; - bytesNeeded = bytesRead > bytesNeeded ? 0 : bytesNeeded - bytesRead; + bytesNeeded = (size_t)bytesRead > bytesNeeded + ? 0 : bytesNeeded - bytesRead; // we hit an EOF char -- bail out, whatever amount of data we have if (hitEOF && *hitEOF) {