diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2010-04-15 20:57:17 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2010-04-15 20:57:17 +0000 |
commit | 182fa5a050d9cc4f382dd7d1d799f90fa711345a (patch) | |
tree | 214e2fe99408ac2d41fb23dad42cc2cc94850e81 /usr.sbin/nsd/zlexer.lex | |
parent | ea33ab4b0ef2e0a4e072a0a3ada4bcbe9d1eea71 (diff) |
NSD v3.2.5
Diffstat (limited to 'usr.sbin/nsd/zlexer.lex')
-rw-r--r-- | usr.sbin/nsd/zlexer.lex | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/nsd/zlexer.lex b/usr.sbin/nsd/zlexer.lex index 0d5ac7e0c9e..0efe7865860 100644 --- a/usr.sbin/nsd/zlexer.lex +++ b/usr.sbin/nsd/zlexer.lex @@ -341,8 +341,8 @@ zoctet(char *text) static int parse_token(int token, char *yytext, enum lexer_state *lexer_state) { - char *str = region_strdup(parser->rr_region, yytext); - size_t len = zoctet(str); + size_t len; + char *str; if (*lexer_state == EXPECT_OWNER) { *lexer_state = PARSING_OWNER; @@ -352,7 +352,7 @@ parse_token(int token, char *yytext, enum lexer_state *lexer_state) uint16_t rrclass; /* type */ - token = rrtype_to_token(str, &yylval.type); + token = rrtype_to_token(yytext, &yylval.type); if (token != 0) { *lexer_state = PARSING_RDATA; LEXOUT(("%d[%s] ", token, yytext)); @@ -360,7 +360,7 @@ parse_token(int token, char *yytext, enum lexer_state *lexer_state) } /* class */ - rrclass = rrclass_from_string(str); + rrclass = rrclass_from_string(yytext); if (rrclass != 0) { yylval.klass = rrclass; LEXOUT(("CLASS ")); @@ -368,13 +368,16 @@ parse_token(int token, char *yytext, enum lexer_state *lexer_state) } /* ttl */ - yylval.ttl = strtottl(str, &t); + yylval.ttl = strtottl(yytext, &t); if (*t == '\0') { LEXOUT(("TTL ")); return T_TTL; } } + str = region_strdup(parser->rr_region, yytext); + len = zoctet(str); + yylval.data.str = str; yylval.data.len = len; |