mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 06:40:18 +00:00
Backports/rewrites wmarquesr pt. 2
This commit is contained in:
parent
e2144c20ff
commit
23e276376a
@ -581,23 +581,28 @@ static struct buffer parse_string(struct buffer buff,
|
|||||||
static struct buffer parse_integer(struct buffer buff,
|
static struct buffer parse_integer(struct buffer buff,
|
||||||
struct rmsgpack_dom_value *value, const char **error)
|
struct rmsgpack_dom_value *value, const char **error)
|
||||||
{
|
{
|
||||||
|
bool test = false;
|
||||||
|
|
||||||
value->type = RDT_INT;
|
value->type = RDT_INT;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (sscanf(buff.data + buff.offset,
|
test = (sscanf(buff.data + buff.offset,
|
||||||
"%I64d",
|
"%I64d",
|
||||||
(signed long long*)&value->val.int_) == 0)
|
(signed long long*)&value->val.int_) == 0);
|
||||||
#else
|
#else
|
||||||
if (sscanf(buff.data + buff.offset,
|
test = (sscanf(buff.data + buff.offset,
|
||||||
"%lld",
|
"%lld",
|
||||||
(signed long long*)&value->val.int_) == 0)
|
(signed long long*)&value->val.int_) == 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (test)
|
||||||
raise_expected_number(buff.offset, error);
|
raise_expected_number(buff.offset, error);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (isdigit((int)buff.data[buff.offset]))
|
while (isdigit((int)buff.data[buff.offset]))
|
||||||
buff.offset++;
|
buff.offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return buff;
|
return buff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user