diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-05-07 14:25:57 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-05-07 17:30:25 +0200 |
commit | 5f68c96da949b08e2afd109d276d80e42cab68b7 (patch) | |
tree | 7a17c7058a776a49581ab1cfac231af697799969 /common | |
parent | 98fbfc3b6126c809eb44c700871facca6ac7727d (diff) |
common: Pacify clang-analyzer
Diffstat (limited to 'common')
-rw-r--r-- | common/buffer.c | 7 |
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 |