From: Jérémie Galarneau Date: Sat, 27 May 2017 10:19:30 +0000 (-0400) Subject: Clean-up: improve readability of dynamic buffer append condition X-Git-Tag: v2.10.0-rc2~40 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b70f1113edc938f2ef1f70a49668caba813bb4ec;p=lttng-tools.git Clean-up: improve readability of dynamic buffer append condition Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/dynamic-buffer.c b/src/common/dynamic-buffer.c index ea26a51ac..f34ae8c49 100644 --- a/src/common/dynamic-buffer.c +++ b/src/common/dynamic-buffer.c @@ -55,7 +55,7 @@ int lttng_dynamic_buffer_append(struct lttng_dynamic_buffer *buffer, goto end; } - if ((buffer->capacity - buffer->size) < len) { + if (buffer->capacity < (len + buffer->size)) { ret = lttng_dynamic_buffer_set_capacity(buffer, buffer->capacity + (len - (buffer->capacity - buffer->size)));