Skip to content

Commit

Permalink
Avoid using C string functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jun 9, 2018
1 parent 63acc5b commit 7e03746
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ansi-c/c_preprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Author: Daniel Kroening, [email protected]
#include <util/tempfile.h>
#include <util/unicode.h>

#include <cstring>
#include <fstream>

#if defined(__linux__) || \
Expand Down Expand Up @@ -120,19 +119,19 @@ static void error_parse_line(

while(*tptr!=0)
{
if(strncmp(tptr, " line ", 6)==0 && state!=4)
if(has_prefix(tptr, " line ") && state != 4)
{
state=1;
tptr+=6;
continue;
}
else if(strncmp(tptr, " column ", 8)==0 && state!=4)
else if(has_prefix(tptr, " column ") && state != 4)
{
state=2;
tptr+=8;
continue;
}
else if(strncmp(tptr, " function ", 10)==0 && state!=4)
else if(has_prefix(tptr, " function ") && state != 4)
{
state=3;
tptr+=10;
Expand Down

0 comments on commit 7e03746

Please sign in to comment.