connection: Use wl_buffer_size() for all buffer size calculations
There were two places where we did the same calculation manually.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
diff --git a/src/connection.c b/src/connection.c
index 7fe35b5..e60ad75 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -178,7 +178,7 @@
int32_t fds[sizeof(buffer->data) / sizeof(int32_t)], i, count;
size_t size;
- size = buffer->head - buffer->tail;
+ size = wl_buffer_size(buffer);
if (size == 0)
return;
@@ -222,7 +222,7 @@
struct cmsghdr *cmsg;
size_t size;
- size = buffer->head - buffer->tail;
+ size = wl_buffer_size(buffer);
if (size > MAX_FDS_OUT * sizeof(int32_t))
size = MAX_FDS_OUT * sizeof(int32_t);