summaryrefslogtreecommitdiffhomepage
path: root/buffer.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-01-25 21:55:25 +0800
committerGitHub <noreply@github.com>2018-01-25 21:55:25 +0800
commite64e25e4d69ddb8f1c7fb8bbdcd09817cae4ca55 (patch)
tree679ecdd500c6355f7b11dbef36c66906065a8ee2 /buffer.c
parentba23b823dcec4203dcee59204f0a7dac1a390d96 (diff)
parent598056d1686127285c389cacbdd20707c350d05a (diff)
Merge pull request #49 from fperrad/20170812_lint
Some linting, const parameters
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/buffer.c b/buffer.c
index 0ca50b4..4b5d56d 100644
--- a/buffer.c
+++ b/buffer.c
@@ -67,7 +67,7 @@ void buf_free(buffer* buf) {
}
/* overwrite the contents of the buffer to clear it */
-void buf_burn(buffer* buf) {
+void buf_burn(const buffer* buf) {
m_burn(buf->data, buf->size);
@@ -91,7 +91,7 @@ buffer* buf_resize(buffer *buf, unsigned int newsize) {
/* Create a copy of buf, allocating required memory etc. */
/* The new buffer is sized the same as the length of the source buffer. */
-buffer* buf_newcopy(buffer* buf) {
+buffer* buf_newcopy(const buffer* buf) {
buffer* ret;
@@ -184,7 +184,7 @@ void buf_putbyte(buffer* buf, unsigned char val) {
/* returns an in-place pointer to the buffer, checking that
* the next len bytes from that position can be used */
-unsigned char* buf_getptr(buffer* buf, unsigned int len) {
+unsigned char* buf_getptr(const buffer* buf, unsigned int len) {
if (len > BUF_MAX_INCR || buf->pos + len > buf->len) {
dropbear_exit("Bad buf_getptr");
@@ -194,7 +194,7 @@ unsigned char* buf_getptr(buffer* buf, unsigned int len) {
/* like buf_getptr, but checks against total size, not used length.
* This allows writing past the used length, but not past the size */
-unsigned char* buf_getwriteptr(buffer* buf, unsigned int len) {
+unsigned char* buf_getwriteptr(const buffer* buf, unsigned int len) {
if (len > BUF_MAX_INCR || buf->pos + len > buf->size) {
dropbear_exit("Bad buf_getwriteptr");