mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
fix for parsing empty data
This commit is contained in:
parent
96bc48c64c
commit
b362a999ce
1 changed files with 2 additions and 1 deletions
|
@ -402,11 +402,12 @@ psycParseRC psyc_parse(psycParseState* state, char* oper, psycString* name, psyc
|
||||||
}
|
}
|
||||||
else // Search for the terminator.
|
else // Search for the terminator.
|
||||||
{
|
{
|
||||||
|
size_t datac = state->cursor; // start of data
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
uint8_t nl = state->buffer.ptr[state->cursor] == '\n';
|
uint8_t nl = state->buffer.ptr[state->cursor] == '\n';
|
||||||
// check for |\n if we're at the start of data or we have found a \n
|
// check for |\n if we're at the start of data or we have found a \n
|
||||||
if (state->cursor == state->startc || nl)
|
if (state->cursor == datac || nl)
|
||||||
{
|
{
|
||||||
if (state->cursor+1+nl >= state->buffer.length) // incremented cursor inside length?
|
if (state->cursor+1+nl >= state->buffer.length) // incremented cursor inside length?
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue