Accetta anche NULL nella add delle token strings.

git-svn-id: svn://10.65.10.50/trunk@29 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-08-17 14:08:59 +00:00
parent 2fc3fcb138
commit bd4da82c82

View File

@ -788,9 +788,7 @@ int TToken_string::items() const
// Certified 99% // Certified 99%
void TToken_string::add(const char* s, int pos) void TToken_string::add(const char* s, int pos)
{ {
if (s) if (s == NULL || *s == '\0') s = " ";
{
if (!*s) s = " ";
if (pos < 0) if (pos < 0)
{ {
if (not_empty()) *this << _separator; if (not_empty()) *this << _separator;
@ -800,12 +798,11 @@ void TToken_string::add(const char* s, int pos)
set_item(s, pos); set_item(s, pos);
if (_last < 0) _last = 0; if (_last < 0) _last = 0;
} }
}
// Certified 0% // Certified 0%
void TToken_string::add(char c, int pos) void TToken_string::add(char c, int pos)
{ {
char s[2] = { c, 0 }; const char s[2] = { c, '\0' };
add(s, pos); add(s, pos);
} }