From 119822d1b2938fae4c9926f4449ea84997670471 Mon Sep 17 00:00:00 2001 From: Gabor Adam Toth Date: Thu, 28 Apr 2011 12:33:06 +0200 Subject: [PATCH] fix for parsing empty data --- src/parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser.c b/src/parser.c index c90dd03..37980ae 100644 --- a/src/parser.c +++ b/src/parser.c @@ -402,11 +402,12 @@ psycParseRC psyc_parse(psycParseState* state, char* oper, psycString* name, psyc } else // Search for the terminator. { + size_t datac = state->cursor; // start of data while (1) { 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 - if (state->cursor == state->startc || nl) + if (state->cursor == datac || nl) { if (state->cursor+1+nl >= state->buffer.length) // incremented cursor inside length? {