Commit ff4e6926 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Fix WS_ReserveSize calls when bytes is equal to free workspace

Currently, with the 505b7bd9 patch, when
calling WS_ReserveSize with bytes equal to the amount of workspace that is
currently available, it will return zero and mark overflow.

This patch redoes the patch, and changes it to return zero and overflow
only when the requested number of bytes is larger than what is available.
parent c18b3baa
......@@ -263,7 +263,7 @@ WS_ReserveSize(struct ws *ws, unsigned bytes)
if (bytes < b2)
b2 = PRNDUP(bytes);
if (ws->f + b2 >= ws->e) {
if (bytes > b2) {
WS_MarkOverflow(ws);
return (0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment