From 40277f3c47e20cb5fb4cc99e998dfbd02dc986fe Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 9 Mar 2010 14:22:42 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:10.0?= =?UTF-8?q?=20670=20Files=20correlati=20=20=20=20=20:ve0=20Ricompilazione?= =?UTF-8?q?=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20:=20sistemate=20alcune=20cosette=20che=20facevano=20morire?= =?UTF-8?q?=20ve0=20nel=20caso=20di=20elaborazione=20con=20articolo=20senz?= =?UTF-8?q?a=20unit=C3=A0=20di=20misura=20principale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@20214 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/relation.cpp | 12 +++++++++--- include/strings.cpp | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/relation.cpp b/include/relation.cpp index a76841393..1733636cc 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -2451,12 +2451,18 @@ void TFieldref::write(const char* val, TRectype& rec) const buffer = rec.get(_name); if (_to <= _from) ((TFieldref*)this)->_to = rec.length(_name); - buffer.overwrite(val, _from, _to - _from); - rec.put(_name, buffer); + if (val && *val) + { + buffer.overwrite(val, _from, _to - _from); + rec.put(_name, buffer); + } } else { - rec.put(_name, val); + if (val && *val) + rec.put(_name, val); + else + rec.zero(_name); } } diff --git a/include/strings.cpp b/include/strings.cpp index a4e9a056a..3f8079076 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -975,7 +975,8 @@ TString& TString::overwrite( // // @xref { - if (lung == 0) lung=strlen(s); + if (lung == 0 && s != NULL) + lung=strlen(s); if (s || lung) { const int l = len();