Skip to content
  • Alexandre Duret-Lutz's avatar
    ltlparse, eltlparse: avoid unnecessary calls to strlen(). · e2143c03
    Alexandre Duret-Lutz authored
    * src/ltlparse/ltlscan.ll, src/ltlparse/parsedecl.hh (flex_set_buffer):
    Take a std::string as argument and call yy_scan_bytes() with
    the string size() instead of calling yy_scan_string() which does
    strlen() on the supplied string.
    * src/ltlparse/ltlparse.yy: Adjust calls.
    * src/eltlparse/eltlscan.ll, src/eltlparse/parsedecl.hh,
    src/eltlparse/eltlparse.yy: Use a similar interface.  This
    also fixes a memory leak as the scanned buffer was not
    released.
    e2143c03