Browse Source

Fix length bug and size warning

master
prpr 3 months ago
parent
commit
ce1b447c99
  1. 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…
Cancel
Save