From 7c3423155f1c5bce245460cce268308b8672897a Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 4 Jul 2011 11:31:35 +0400 Subject: [PATCH] segfault --- c/tex_parser/tex_parser.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/c/tex_parser/tex_parser.c b/c/tex_parser/tex_parser.c index 57c82e2..c36d30c 100644 --- a/c/tex_parser/tex_parser.c +++ b/c/tex_parser/tex_parser.c @@ -160,6 +160,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error) case IN_TAGPARM: if (c == '{' || c == '[') { // tag params + zclear(¶m); where_stack[++tex_level] = IN_TAGPARM; } else if (c == '}' || c == ']') { // end tag params @@ -183,6 +184,8 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error) source[i], (u_int8_t)source[i], i); return; } + + zalloc_append8_str(param, c); break; case IN_TAG_UNKNOWN: @@ -251,10 +254,11 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error) break; }//*/ - if (c == '{' || c == '[') + if (c == '{' || c == '[') { + zclear(¶m); where_stack[++tex_level] = IN_TAGPARM; - else if (c == '}' || c == ']') { + } else if (c == '}' || c == ']') { where_stack[tex_level--] = IN_UNDEF; i--;