new type cw_type_ipaddress

FossilOrigin-Name: 9d8ad0bb712a80f52f4be5addec28710e0d0a323992621ee7affef86b9ff2166
This commit is contained in:
7u83@mail.ru
2018-03-21 17:50:07 +00:00
parent 8dd91ab6af
commit 95a253f470
6 changed files with 23 additions and 9 deletions

View File

@ -25,6 +25,9 @@
#include <string.h>
#include <stdlib.h>
#include "bstr.h"
/**
* Creates a bstr_t string.
* @param data source data to create the string from
@ -34,7 +37,7 @@
* The bstr_t string returned is allocated by malloc. So remember to free
* this resource if you don't need it anymore.
*/
uint8_t * bstr_create(uint8_t *data, uint8_t len)
uint8_t * bstr_create(const uint8_t *data, uint8_t len)
{
uint8_t * str = malloc(1+len*sizeof(uint8_t));
if (!str)
@ -43,3 +46,4 @@ uint8_t * bstr_create(uint8_t *data, uint8_t len)
memcpy(str+1,data,len);
return str;
}