diff --git a/nbd/client.c b/nbd/client.c index 5c9dee37fae94b8008f0677335d7968c099a0300..3dc2564cd0f8b518c83fdbbbc1c06afb1c38388c 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -94,7 +94,7 @@ static ssize_t drop_sync(QIOChannel *ioc, size_t size) char small[1024]; char *buffer; - buffer = sizeof(small) < size ? small : g_malloc(MIN(65536, size)); + buffer = sizeof(small) >= size ? small : g_malloc(MIN(65536, size)); while (size > 0) { ssize_t count = read_sync(ioc, buffer, MIN(65536, size));