From 5f68c96da949b08e2afd109d276d80e42cab68b7 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 7 May 2018 14:25:57 +0200 Subject: common: Pacify clang-analyzer --- common/buffer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/buffer.c b/common/buffer.c index f2e2cb8..668a259 100644 --- a/common/buffer.c +++ b/common/buffer.c @@ -149,6 +149,7 @@ p11_buffer_append (p11_buffer *buffer, size_t terminator; size_t newlen; size_t reserve; + size_t offset; return_val_if_fail (p11_buffer_ok (buffer), NULL); @@ -174,11 +175,11 @@ p11_buffer_append (p11_buffer *buffer, } data = buffer->data; - data += buffer->len; + offset = buffer->len; buffer->len += length; if (terminator) - data[length] = '\0'; - return data; + data[buffer->len] = '\0'; + return data + offset; } void -- cgit v1.1