diff --git a/include/psyc/parse.h b/include/psyc/parse.h index 4a5b492..edc4117 100644 --- a/include/psyc/parse.h +++ b/include/psyc/parse.h @@ -416,8 +416,7 @@ psycParseRC psyc_parse (psycParseState *state, char *oper, * @param value Contains the list to be parsed. * @param elem It will point to the next element in the list. */ -psycParseListRC psyc_parseList (psycParseListState *state, psycString *value, - psycString *elem); +psycParseListRC psyc_parseList (psycParseListState *state, psycString *elem); /** @} */ // end of parse group diff --git a/src/Makefile b/src/Makefile index 25df0c6..3ef9d67 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,7 @@ diet: lib lib: $O @mkdir -p ../lib - ${WRAPPER} ar rcs ../lib/libpsyc.a $O + ${WRAPPER} ${AR} rcs ../lib/libpsyc.a $O match: match.c ${CC} -o $@ -DDEBUG=4 -DCMDTOOL -DTEST $< diff --git a/src/parse.c b/src/parse.c index 0bfc6c1..a1f5798 100644 --- a/src/parse.c +++ b/src/parse.c @@ -483,8 +483,7 @@ psycParseRC psyc_parse (psycParseState *state, char *oper, } /** List parser. */ -psycParseListRC psyc_parseList (psycParseListState *state, psycString *value, - psycString *elem) +psycParseListRC psyc_parseList (psycParseListState *state, psycString *elem) { if (state->cursor >= state->buffer.length) return PSYC_PARSE_LIST_INCOMPLETE; diff --git a/src/render.c b/src/render.c index 3d9d31b..ad4822d 100644 --- a/src/render.c +++ b/src/render.c @@ -34,6 +34,8 @@ psycRenderListRC psyc_renderList (psycList *list, char *buffer, size_t buflen) } } + // actual length should be equal to pre-calculated length at this point + assert(cur == list->length); return PSYC_RENDER_LIST_SUCCESS; } diff --git a/test/testParser.c b/test/testParser.c index e312910..641c70d 100644 --- a/test/testParser.c +++ b/test/testParser.c @@ -67,7 +67,7 @@ int main (int argc, char **argv) psyc_initParseListState(&listState); psyc_setParseListBuffer(&listState, value); - while ((ret = psyc_parseList(&listState, &value, &elem))) + while ((ret = psyc_parseList(&listState, &elem))) { switch (ret) { diff --git a/test/testServer.c b/test/testServer.c index 78dbcc1..44cf31e 100644 --- a/test/testServer.c +++ b/test/testServer.c @@ -453,7 +453,7 @@ int main (int argc, char **argv) do { - retl = psyc_parseList(&listState, pvalue, &elem); + retl = psyc_parseList(&listState, &elem); switch (retl) { case PSYC_PARSE_LIST_END: @@ -468,7 +468,7 @@ int main (int argc, char **argv) break; default: - printf("# Error while parsing list: %i\n", ret); + printf("# Error while parsing list: %i\n", retl); ret = retl = -1; } }