2005-04-24 15:02:04 -04:00
|
|
|
$OpenBSD: patch-resParser_l,v 1.3 2005/04/24 19:02:05 sturm Exp $
|
|
|
|
--- resParser.l.orig Thu Dec 25 22:32:56 2003
|
|
|
|
+++ resParser.l Thu Apr 21 20:07:16 2005
|
|
|
|
@@ -63,15 +63,7 @@ iddot [a-zA-Z][a-zA-Z0-9\.]*
|
|
|
|
<GEOM_SC>{
|
|
|
|
|
2002-04-09 11:43:40 -04:00
|
|
|
{geomspec} {
|
2005-04-24 15:02:04 -04:00
|
|
|
- int len = ::strlen( yytext );
|
|
|
|
- if ( len >= LEX_BUFFER_MAX ) {
|
2002-04-09 11:43:40 -04:00
|
|
|
- ::strncpy( lexerBuffer, yytext, LEX_BUFFER_MAX );
|
2005-04-24 15:02:04 -04:00
|
|
|
- lexerBuffer[ LEX_BUFFER_MAX-1 ] = 0;
|
|
|
|
- }
|
|
|
|
- else {
|
2002-04-09 11:43:40 -04:00
|
|
|
- ::strncpy( lexerBuffer, yytext, len );
|
2005-04-24 15:02:04 -04:00
|
|
|
- lexerBuffer[ len ] = 0;
|
|
|
|
- }
|
|
|
|
+ ::strlcpy( lexerBuffer, yytext, LEX_BUFFER_MAX );
|
2002-04-09 11:43:40 -04:00
|
|
|
yylval->str = lexerBuffer;
|
2005-04-24 15:02:04 -04:00
|
|
|
BEGIN(INITIAL);
|
|
|
|
return GEOMSPEC;
|
|
|
|
@@ -205,15 +197,7 @@ iddot [a-zA-Z][a-zA-Z0-9\.]*
|
|
|
|
|
|
|
|
{string} {
|
2002-04-09 11:43:40 -04:00
|
|
|
/* strip the quotes */
|
2005-04-24 15:02:04 -04:00
|
|
|
- int len = ::strlen( yytext );
|
|
|
|
- if ( len >= LEX_BUFFER_MAX ) {
|
2002-04-09 11:43:40 -04:00
|
|
|
- ::strncpy( lexerBuffer, &(yytext[1]), LEX_BUFFER_MAX );
|
2005-04-24 15:02:04 -04:00
|
|
|
- lexerBuffer[ LEX_BUFFER_MAX-1 ] = 0;
|
|
|
|
- }
|
|
|
|
- else {
|
2002-04-09 11:43:40 -04:00
|
|
|
- ::strncpy( lexerBuffer, &(yytext[1]), len-2 );
|
2005-04-24 15:02:04 -04:00
|
|
|
- lexerBuffer[ len-2 ] = 0;
|
|
|
|
- }
|
|
|
|
+ ::strlcpy( lexerBuffer, &(yytext[1]), LEX_BUFFER_MAX );
|
2002-04-09 11:43:40 -04:00
|
|
|
yylval->str = lexerBuffer;
|
2005-04-24 15:02:04 -04:00
|
|
|
return STRING;
|
|
|
|
}
|