summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
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