diff options
author | 2020-09-24 07:53:56 +0200 | |
---|---|---|
committer | 2020-09-24 15:22:25 +0200 | |
commit | 0acb9992f4c73db6f865ed89411ce4db20cee9f2 (patch) | |
tree | 21203310f91c9590da371e2826395e75eb00d99a /src/lib/netlist/plib/pfunction.cpp | |
parent | dd5769bea9d3ef209c5cd46507ef6d4800ee1ccf (diff) |
netlist: make pstring length/size use consistent.
* length reports the number of character codes in the string
* size reports the size in memory units
* Reminder: Set PSTRING_USE_STD_STRING to 1 in pstring.h and get
native std::string
* pstrings are compatible to std::string but only support a limited
subset of functionality.
* By default (always like this) utf8 is supported and thus length
reports the number of multi-byte characters.
Diffstat (limited to 'src/lib/netlist/plib/pfunction.cpp')
-rw-r--r-- | src/lib/netlist/plib/pfunction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index 5a00844becc..3ab937735cf 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -143,7 +143,7 @@ namespace plib { if (r == units_si<fl_t>().end()) rc.m_param.val = plib::pstonum_ne<fl_t>(cmd, err); else - rc.m_param.val = plib::pstonum_ne<fl_t>(plib::left(cmd, cmd.size()-1), err) * r->second; + rc.m_param.val = plib::pstonum_ne<fl_t>(plib::left(cmd, cmd.length()-1), err) * r->second; if (err) throw pexception(plib::pfmt("pfunction: unknown/misformatted token <{1}> in <{2}>")(cmd)(expr)); stk += 1; |