summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-05-07 14:25:57 +0200
committerDaiki Ueno <ueno@gnu.org>2018-05-07 17:30:25 +0200
commit5f68c96da949b08e2afd109d276d80e42cab68b7 (patch)
tree7a17c7058a776a49581ab1cfac231af697799969 /common
parent98fbfc3b6126c809eb44c700871facca6ac7727d (diff)
common: Pacify clang-analyzer
Diffstat (limited to 'common')
-rw-r--r--common/buffer.c7
1 files changed, 4 insertions, 3 deletions
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