Fix wild memory poiters in vhdlint parsing.

This commit is contained in:
Stephen Williams 2011-02-13 17:14:33 -08:00
parent f32ede23b7
commit 7f6199fbcb
1 changed files with 2 additions and 3 deletions

View File

@ -51,7 +51,7 @@ vhdlint::vhdlint(const char* text)
const char* ptr; const char* ptr;
char* new_ptr; char* new_ptr;
for(ptr = text, new_ptr = new_text; *ptr != '\0'; ++ptr) for(ptr = text, new_ptr = new_text; *ptr != 0; ++ptr)
{ {
if(*ptr == '_') if(*ptr == '_')
continue; continue;
@ -59,10 +59,9 @@ vhdlint::vhdlint(const char* text)
{ {
*new_ptr = *ptr; *new_ptr = *ptr;
++new_ptr; ++new_ptr;
++ptr;
} }
} }
*new_ptr = '\0'; *new_ptr = 0;
istringstream str(new_text); istringstream str(new_text);
delete[] new_text; delete[] new_text;