summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/lang.l
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/config/lang.l')
-rw-r--r--usr.sbin/config/lang.l5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l
index be6a24c..d4052f3 100644
--- a/usr.sbin/config/lang.l
+++ b/usr.sbin/config/lang.l
@@ -35,6 +35,7 @@
*/
#include <ctype.h>
+#include <string.h>
#include "y.tab.h"
#include "config.h"
@@ -117,7 +118,7 @@ WORD [A-Za-z_][-A-Za-z_]*
if ((i = kw_lookup(yytext)) == -1)
{
- yylval.str = yytext;
+ yylval.str = strdup(yytext);
tprintf("id(%s) ", yytext);
return ID;
}
@@ -126,7 +127,7 @@ WORD [A-Za-z_][-A-Za-z_]*
}
\"[^"]+\" {
yytext[strlen(yytext)-1] = '\0';
- yylval.str = yytext + 1;
+ yylval.str = strdup(yytext + 1);
return ID;
}
0[0-7]* {
OpenPOWER on IntegriCloud