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

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