Work in progress

FossilOrigin-Name: 155605fd55cbb193d4f5ac8c704930c050a11cda541f1a5cdb93c57a8c51534f
This commit is contained in:
7u83@mail.ru
2018-03-17 11:32:40 +00:00
parent c4307d9e70
commit b668a8f4a9
63 changed files with 770 additions and 982 deletions

View File

@ -4,7 +4,10 @@
uint8_t * bstr16_create_from_str(const char *s)
{
int l = strlen(s);
uint8_t * mem;
int msize;
int l;
l = strlen(s);
if (s[0]!='.')
return bstr16_create((uint8_t*)s,l);
@ -19,10 +22,10 @@ uint8_t * bstr16_create_from_str(const char *s)
/* the string starts with ".x" - read hexbytes */
l-=2;
int msize=l/2;
msize=l/2;
if(l&1)
msize++;
uint8_t * mem = malloc(2+msize);
mem = malloc(2+msize);
*((uint16_t*)mem)=msize;
cw_format_scan_hex_bytes(mem+2,s+2,l);
return mem;