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.11.0-rc1~560 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=830630679a7fb4bc9b3c7679b5168ee6c03104f1;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)));