Aggiunta l'accettazione dei NULL pointer come parametri nella rewrite

git-svn-id: svn://10.65.10.50/trunk@4214 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
augusto 1997-03-18 09:28:36 +00:00
parent cc86160256
commit 0ae2f8de88

View File

@ -762,6 +762,8 @@ TString& TString::overwrite(
//
// @xref <mf TString::insert>
{
if (s)
{
const int l = len();
if (pos < 0) pos = l;
const int max = pos+strlen(s);
@ -771,7 +773,7 @@ TString& TString::overwrite(
for (int i = l; i < pos; i++) _str[i] = ' '; // space padding
for (; *s; s++) _str[pos++] = *s; // write
if (over) _str[pos] = '\0'; // end of string
}
return *this;
}