Module: sip-router
Branch: master
Commit: 10e82c040dbf2ca5a3b200b2b232b9c362092706
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=10e82c0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Jun 30 22:18:52 2009 +0200
core: parse_event - skip first ; for parameters
- skip ; after event body
- event debug function prints to stderr since stdout is closed
---
parser/parse_event.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/parser/parse_event.c b/parser/parse_event.c
index 98ca5e5..3d4b6b2 100644
--- a/parser/parse_event.c
+++ b/parser/parse_event.c
@@ -119,6 +119,8 @@ int event_parser(char* s, int len, event_t* e)
if (tmp.s[0] == ';') {
/* We have parameters to parse */
+ tmp.s++;
+ tmp.len--;
if (e->type == EVENT_DIALOG) {
pclass = CLASS_EVENT_DIALOG;
phooks = (param_hooks_t*)&e->params.dialog;
@@ -184,11 +186,11 @@ void free_event(event_t** _e)
*/
void print_event(event_t* e)
{
- printf("===Event===\n");
- printf("name : \'%.*s\'\n", STR_FMT(&e->name));
- printf("type: %d\n", e->type);
+ fprintf(stderr, "===Event===\n");
+ fprintf(stderr, "name : \'%.*s\'\n", STR_FMT(&e->name));
+ fprintf(stderr, "type: %d\n", e->type);
if (e->params.list) {
- print_params(stdout, e->params.list);
+ print_params(stderr, e->params.list);
}
- printf("===/Event===\n");
+ fprintf(stderr, "===/Event===\n");
}