Fix length bug and size warning
This commit is contained in:
parent
9ba7bd84db
commit
ce1b447c99
4
xconv.c
4
xconv.c
@ -9,7 +9,7 @@ add_unicode(char **d, size_t *len, uint16_t u)
|
||||
// 1 byte
|
||||
if (*len < 1) return 0;
|
||||
(*d)[0] = u;
|
||||
(*d)++, *len--;
|
||||
(*d)++, (*len)--;
|
||||
return 1;
|
||||
}
|
||||
if (u < 0x800)
|
||||
@ -22,7 +22,9 @@ add_unicode(char **d, size_t *len, uint16_t u)
|
||||
*d += 2, *len -= 2;
|
||||
return 1;
|
||||
}
|
||||
#if 0
|
||||
if (u < 0x10000)
|
||||
#endif
|
||||
{
|
||||
// 3 bytes
|
||||
if (*len < 3) return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user