diff --git a/include/isam.cpp b/include/isam.cpp index 6a27c4007..5b2beaebd 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -4144,9 +4144,11 @@ void TRecfield::set(int from, int to) if (nf == FIELDERR) { if (_rec->exist(_name)) - _subfield = _name; + _subfield = _name.get_buffer(); else - NFCHECK("File n. %d unknown field %s", _rec->num(), _name); _p = _rec->string(); + NFCHECK("File n. %d unknown field %s", _rec->num(), (const char*)_name); + + _p = _rec->string(); _len = 0; _dec = 0; _type = _alfafld; @@ -4306,27 +4308,28 @@ void TRecfield::get_subfield(TString& s) const const TString& str = _rec->get(_name); if (strcmp(_name, _subfield) == 0) - s =, str; + s = str; else { - int p = str.find(_subfield); + int p = str.find(_subfield); - if (p == 0 || (p > 0 && str[p - 1] < ' ')) - { - p += strlen(_subfield); - - int e = str.find('\n', p); + if (p == 0 || (p > 0 && str[p - 1] < ' ')) + { + p += strlen(_subfield); + + int e = str.find('\n', p); - if (_to > 0 && p + _to < e) - e = p + _to; - p += _from; - if (p < e) - s = str.sub(p, e); - else + if (_to > 0 && p + _to < e) + e = p + _to; + p += _from; + if (p < e) + s = str.sub(p, e); + else + s.cut(0); + } + else s.cut(0); } - else - s.cut(0); } TRecfield::operator int() const