ui/vnc: clarify intent using buffer_empty() function
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
Mar 13, 2026 at 23:01 UTC
58f1f386b8896748bb2f6165afdfdf8847a8789f
2 files changed
+2
-2
ui/vnc-jobs.c
+1
-1
@@ -160,7 +160,7 @@ void vnc_jobs_consume_buffer(VncState *vs)
160
bool flush;
161
162
vnc_lock_output(vs);
163
- if (vs->jobs_buffer.offset) {
163
+ if (!buffer_empty(&vs->jobs_buffer)) {
164
if (vs->ioc != NULL && buffer_empty(&vs->output)) {
165
g_clear_handle_id(&vs->ioc_tag, g_source_remove);
166
if (vs->disconnecting == FALSE) {
ui/vnc.c
+1
-1
@@ -1718,7 +1718,7 @@ void vnc_write_u8(VncState *vs, uint8_t value)
1718
void vnc_flush(VncState *vs)
1719
{
1720
vnc_lock_output(vs);
1721
- if (vs->ioc != NULL && vs->output.offset) {
1721
+ if (vs->ioc != NULL && !buffer_empty(&vs->output)) {
1722
vnc_client_write_locked(vs);
1723
}
1724
if (vs->disconnecting) {