mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
(libretro-db) Cleanup
This commit is contained in:
parent
69b457a427
commit
c1634914d6
@ -966,6 +966,7 @@ void *libretrodb_query_compile(libretrodb_t *db,
|
|||||||
/* TODO/FIXME - static local variable */
|
/* TODO/FIXME - static local variable */
|
||||||
static char tmp_error_buff [MAX_ERROR_LEN] = {0};
|
static char tmp_error_buff [MAX_ERROR_LEN] = {0};
|
||||||
struct query *q = (struct query*)malloc(sizeof(*q));
|
struct query *q = (struct query*)malloc(sizeof(*q));
|
||||||
|
size_t error_buff_len = sizeof(tmp_error_buff);
|
||||||
|
|
||||||
if (!q)
|
if (!q)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -985,24 +986,27 @@ void *libretrodb_query_compile(libretrodb_t *db,
|
|||||||
if (query_peek(buff, "{"))
|
if (query_peek(buff, "{"))
|
||||||
{
|
{
|
||||||
buff = query_parse_table(tmp_error_buff,
|
buff = query_parse_table(tmp_error_buff,
|
||||||
sizeof(tmp_error_buff), buff, &q->root, error_string);
|
error_buff_len, buff, &q->root, error_string);
|
||||||
if (*error_string)
|
if (*error_string)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
else if (isalpha((int)buff.data[buff.offset]))
|
else if (isalpha((int)buff.data[buff.offset]))
|
||||||
buff = query_parse_method_call(tmp_error_buff,
|
buff = query_parse_method_call(tmp_error_buff,
|
||||||
sizeof(tmp_error_buff),
|
error_buff_len,
|
||||||
buff, &q->root, error_string);
|
buff, &q->root, error_string);
|
||||||
|
|
||||||
buff = query_expect_eof(tmp_error_buff,
|
buff = query_expect_eof(tmp_error_buff,
|
||||||
sizeof(tmp_error_buff), buff, error_string);
|
error_buff_len,
|
||||||
|
buff, error_string);
|
||||||
|
|
||||||
if (*error_string)
|
if (*error_string)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!q->root.func)
|
if (!q->root.func)
|
||||||
{
|
{
|
||||||
query_raise_unexpected_eof(
|
query_raise_unexpected_eof(
|
||||||
tmp_error_buff, sizeof(tmp_error_buff),
|
tmp_error_buff,
|
||||||
|
error_buff_len,
|
||||||
buff.offset, error_string);
|
buff.offset, error_string);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user