From bb9014e64a98ba108f6ca0cf005f6791a7c71164 Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 27 Feb 2006 21:41:24 +0000 Subject: [PATCH] genevent xml std git-svn-id: http://ltt.polymtl.ca/svn@1560 04897980-b3bd-0310-b5e0-8ef037075253 --- genevent-new/parser.c | 54 +++++++++++++++++++++++++++++++++++-------- genevent-new/parser.h | 3 +-- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/genevent-new/parser.c b/genevent-new/parser.c index 2d8c9c4a..bcae82e1 100644 --- a/genevent-new/parser.c +++ b/genevent-new/parser.c @@ -97,11 +97,26 @@ int getSizeindex(unsigned int value) unsigned long long int getSize(parse_file_t *in) { char *token; + int has_quotes = 0; + unsigned long long int ret; token = getToken(in); + if(token[0] == '"') { + has_quotes = 1; + token = getToken(in); + } if(in->type == NUMBER) { - return strtoull(token, NULL, 0); - } + ret = strtoull(token, NULL, 0); + } else { + goto error; + } + if(has_quotes) { + token = getToken(in); + if(token[0] != '"') goto error; + } + + return ret; +error: in->error(in,"incorrect size specification"); return -1; } @@ -360,21 +375,40 @@ char *getNameAttribute(parse_file_t *in) //for