From a3cccb5fdab67e15e380ac943c0b54071e12b337 Mon Sep 17 00:00:00 2001 From: Marenz Date: Sun, 17 Apr 2011 14:22:01 +0200 Subject: [PATCH] fixed a bug --- src/parser.c | 7 ++----- src/tests/parser/testParser.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/parser.c b/src/parser.c index dfdc901..23e505d 100644 --- a/src/parser.c +++ b/src/parser.c @@ -321,7 +321,7 @@ start: return PSYC_INSUFFICIENT; // return insufficient } - while(isNumeric(state->buffer.ptr[state->cursor])); + while(isNumeric(state->buffer.ptr[state->cursor])) { binLength = 10 * binLength + state->buffer.ptr[state->cursor] - '0'; @@ -380,10 +380,7 @@ start: state->cursor+=1; state->inBody = 1; - if (state->flags & PSYC_HEADER_ONLY) - return PSYC_HEADER_COMPLETE; // return header finished - else - goto start; + return PSYC_ROUTING; // return header finished } if(state->buffer.ptr[state->cursor] != '|') // no pipe, then only line complete, not the packet. diff --git a/src/tests/parser/testParser.c b/src/tests/parser/testParser.c index 2939f64..773f831 100644 --- a/src/tests/parser/testParser.c +++ b/src/tests/parser/testParser.c @@ -32,8 +32,8 @@ int main(int argc, char** argv) { case PSYC_ROUTING: case PSYC_ENTITY: - case PSYC_METHOD: write(0,&modifier,1); + case PSYC_METHOD: write(0,name.ptr, name.length); write(0," = ", 3); write(0,value.ptr, value.length);