Skip to content

Commit

Permalink
Do not use intermediate parsing result as formula
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Summo committed Dec 5, 2024
1 parent 2a49ec6 commit b47ae9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sffe/sffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ int sffe_parse(sffe **parser, const char *expression)

/* _parser->expression = (char *)realloc((char *)_parser->expression,
strlen(_parser->expression) + 1); */
const char* _tempexpr = _parser->expression;
_parser->expression = buflen > 0 ? (char *)realloc((char *)buf, strlen(buf) + 1) : new char{'\0'};

if (ui1 && !err) {
Expand Down Expand Up @@ -1207,7 +1208,9 @@ int sffe_parse(sffe **parser, const char *expression)
#ifdef SFFE_DEVEL
printf("\nparse - END\n");
#endif

//TODO
delete _parser->expression;
_parser->expression = _tempexpr;
return err;
}

Expand Down

0 comments on commit b47ae9a

Please sign in to comment.