diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-06-04 23:08:50 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-06-04 23:08:50 +0800 |
commit | 1a4db21fe4e06f4a5e5b74e35027091370b54abb (patch) | |
tree | 7543bf0e7a5d133c5564dd0ddcf35685bc308a98 /buffer.c | |
parent | e7ac4c1ab3eee827d781ececf6c7342c432b91d3 (diff) |
buf_getstring and buf_putstring now use non-unsigned char*
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -203,10 +203,10 @@ unsigned char* buf_getwriteptr(buffer* buf, unsigned int len) { /* Return a null-terminated string, it is malloced, so must be free()ed * Note that the string isn't checked for null bytes, hence the retlen * may be longer than what is returned by strlen */ -unsigned char* buf_getstring(buffer* buf, unsigned int *retlen) { +char* buf_getstring(buffer* buf, unsigned int *retlen) { unsigned int len; - unsigned char* ret; + char* ret; len = buf_getint(buf); if (len > MAX_STRING_LEN) { dropbear_exit("String too long"); @@ -262,16 +262,16 @@ void buf_putint(buffer* buf, int unsigned val) { } /* put a SSH style string into the buffer, increasing buffer len if required */ -void buf_putstring(buffer* buf, const unsigned char* str, unsigned int len) { +void buf_putstring(buffer* buf, const char* str, unsigned int len) { buf_putint(buf, len); - buf_putbytes(buf, str, len); + buf_putbytes(buf, (const unsigned char*)str, len); } /* puts an entire buffer as a SSH string. ignore pos of buf_str. */ void buf_putbufstring(buffer *buf, const buffer* buf_str) { - buf_putstring(buf, buf_str->data, buf_str->len); + buf_putstring(buf, (const char*)buf_str->data, buf_str->len); } /* put the set of len bytes into the buffer, incrementing the pos, increasing |