summaryrefslogtreecommitdiff
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c
index cd0d947..0641989 100644
--- a/src/common.c
+++ b/src/common.c
@@ -125,7 +125,7 @@ static rdflush_t rd_flush;
void Com_BeginRedirect(int target, char *buffer, size_t buffersize, rdflush_t flush)
{
- if (rd_target || !target || !buffer || buffersize < 1 || !flush) {
+ if (rd_target || !target || !buffer || !buffersize || !flush) {
return;
}
rd_target = target;
@@ -166,7 +166,7 @@ static void Com_Redirect(const char *msg, size_t total)
if (length > rd_buffersize) {
length = rd_buffersize;
}
- if (rd_length + length > rd_buffersize) {
+ if (rd_length > rd_buffersize - length) {
rd_flush(rd_target, rd_buffer, rd_length);
rd_length = 0;
}