Use hb_parse_uint in deserializer token parser
This commit is contained in:
parent
3d5b1df7ab
commit
005389beb5
|
@ -396,9 +396,12 @@ parse_int (const char *pp, const char *end, int32_t *pv)
|
||||||
static bool
|
static bool
|
||||||
parse_uint (const char *pp, const char *end, uint32_t *pv)
|
parse_uint (const char *pp, const char *end, uint32_t *pv)
|
||||||
{
|
{
|
||||||
int32_t v;
|
unsigned int v;
|
||||||
if (!parse_int (pp, end, &v))
|
const char *p = pp;
|
||||||
return false;
|
if (unlikely (!hb_parse_uint (&p, end, &v))) return false;
|
||||||
|
|
||||||
|
/* Check if parser consumed all of the buffer */
|
||||||
|
if (unlikely (p != end)) return false;
|
||||||
|
|
||||||
*pv = v;
|
*pv = v;
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue