summaryrefslogtreecommitdiff
path: root/Kernel/VirtualConsole.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-25 21:19:57 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-25 21:21:12 +0100
commitbeda4788216509fdf846e5bb6f6000b8b542ca11 (patch)
treeb7ed890f13d5c1629b434fa202b4f1ca9a232c50 /Kernel/VirtualConsole.cpp
parent5af4e622b94a194e3feaea1b3b09229d7a93578b (diff)
downloadserenity-beda4788216509fdf846e5bb6f6000b8b542ca11.zip
Kernel: Make syscalls that take a buffer size use ssize_t instead of size_t.
Dealing with the unsigned overflow propagation here just seems unreasonably error prone. Let's limit ourselves to 2GB buffer sizes instead.
Diffstat (limited to 'Kernel/VirtualConsole.cpp')
-rw-r--r--Kernel/VirtualConsole.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/VirtualConsole.cpp b/Kernel/VirtualConsole.cpp
index 08bebe8624..acaf14686e 100644
--- a/Kernel/VirtualConsole.cpp
+++ b/Kernel/VirtualConsole.cpp
@@ -499,10 +499,10 @@ void VirtualConsole::on_sysconsole_receive(byte ch)
m_current_attribute = old_attribute;
}
-ssize_t VirtualConsole::on_tty_write(const byte* data, size_t size)
+ssize_t VirtualConsole::on_tty_write(const byte* data, ssize_t size)
{
InterruptDisabler disabler;
- for (size_t i = 0; i < size; ++i)
+ for (ssize_t i = 0; i < size; ++i)
on_char(data[i]);
return size;
}