diff options
Diffstat (limited to 'source/com_local.h')
-rw-r--r-- | source/com_local.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/com_local.h b/source/com_local.h index ed45dbf..10df295 100644 --- a/source/com_local.h +++ b/source/com_local.h @@ -382,19 +382,19 @@ int FIFO_Read( fifo_t *fifo, void *buffer, int length ); int FIFO_Write( fifo_t *fifo, const void *buffer, int length ); static inline qboolean FIFO_TryRead( fifo_t *fifo, void *buffer, int length ) { - if( FIFO_Read( fifo, NULL, length ) == length ) { - FIFO_Read( fifo, buffer, length ); - return qtrue; + if( FIFO_Read( fifo, NULL, length ) < length ) { + return qfalse; } - return qfalse; + FIFO_Read( fifo, buffer, length ); + return qtrue; } static inline qboolean FIFO_TryWrite( fifo_t *fifo, void *buffer, int length ) { - if( FIFO_Write( fifo, NULL, length ) == length ) { - FIFO_Write( fifo, buffer, length ); - return qtrue; + if( FIFO_Write( fifo, NULL, length ) < length ) { + return qfalse; } - return qfalse; + FIFO_Write( fifo, buffer, length ); + return qtrue; } /* |