Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site enea.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!decvax!mcvax!enea!kim From: kim@enea.UUCP Newsgroups: net.unix-wizards Subject: Re: lex(1) bug -- lex users BEWARE! - (nf) Message-ID: <223@enea.UUCP> Date: Mon, 7-May-84 04:00:17 EST Article-I.D.: enea.223 Posted: Mon May 7 04:00:17 1984 Date-Received: Fri, 27-Apr-84 06:05:57 EST Sender: notes@enea.UUCP Organization: ENEA DATA, Sweden Lines: 22 #R:burl:-43600:enea:600001:000:583 enea!kim Apr 24 11:03:00 1984 Yes, I was hit by this bug a year ago. Looking at the output from lex (the version supplied with 4.1bsd) reveals that the size of 'yytext' and some related areas are only 200 chars! Since lex does not check for overflow, the simplest fix is to increase the buffer size by redefining the symbol YYLMAX. After discovering the bug, I routinely include the following two lines: # undef YYLMAX # define YYLMAX 10000 at the start of each lex program, and then I will get a 'bus error' only when trying to match an abnormally long string by mistake. Kim Walden ...mcvax!enea!kim