Skip to content

lburg - fix strchr when buffer doesn't have an eol.#23

Open
ksherlock wants to merge 1 commit intodrh:masterfrom
ksherlock:lburg_no_eol
Open

lburg - fix strchr when buffer doesn't have an eol.#23
ksherlock wants to merge 1 commit intodrh:masterfrom
ksherlock:lburg_no_eol

Conversation

@ksherlock
Copy link

if strchr(bp, '\n') didn't find anything the first time, it won't find anything the second time, either.
Change to'\0' to find the end-of-line. It's still a syntax error (the grammar requires a '\n') but it won't cause an alloc error.

This is only an issue if there's no end-of-line while lexing a rule's cost code (so not a problem with any of lcc's files).

if strchr(bp, '\n') didn't find anything the first time, it won't find anything the second time, either.
Change to '\0' to find the end-of-line. It's still a syntax error (the grammar requires a '\n') but it won't cause an alloc error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant