mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 16:45:10 +00:00
[FIX] Fix more unistr fuckups
This commit is contained in:
parent
b9954c06ce
commit
dba3dcc85f
1 changed files with 3 additions and 4 deletions
|
|
@ -28,11 +28,11 @@ UnistrAddch(Unistr *unistr, uint32_t u)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
UTFIsN(char *off, size_t available, int n, uint8_t pc)
|
UTFIsN(char *off, size_t available, size_t n, uint8_t pc)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
uint8_t *offu = (uint8_t *) off;
|
uint8_t *offu = (uint8_t *) off;
|
||||||
if ((available < n) || ((*offu >> (8-n-1)) != pc))
|
if (((available < n) || ((*offu >> (8-n-1)) != pc)) && (n >= 1))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -52,7 +52,6 @@ UnistrCreate(char *src)
|
||||||
{
|
{
|
||||||
size_t len, i;
|
size_t len, i;
|
||||||
Unistr *str;
|
Unistr *str;
|
||||||
char *start;
|
|
||||||
if (!src)
|
if (!src)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue