Patch level : 12.0 no-patch

Files correlati     :
Commento            :

Corretta destroy delle Token_string nel caso dell'ultimo elemento.
corretta add  delle Token_string di un booleano
This commit is contained in:
Alessandro Bonazzi 2020-07-26 09:57:09 +02:00
parent 8d408f4df2
commit b3eb8fb295
2 changed files with 10 additions and 3 deletions

View File

@ -1976,8 +1976,15 @@ void TToken_string::destroy(int n)
if (sep >= n)
{
const char* p = strchr(s, _separator);
*s = '\0';
if (p != NULL) strcat(s, p+1);
if (p != NULL)
{
*s = '\0';
strcat(s, p + 1);
}
else
if (*(--s) == _separator)
*s = '\0';
}
}
restart();

View File

@ -674,7 +674,7 @@ public:
// @cmember Aggiunge una data
void add(const TDate d, int pos = -1);
// @cmember Aggiunge un booleano
void add(bool on, int pos = -1) { add(on ? "X" : ""); }
void add(bool on, int pos = -1) { add(on ? "X" : "", pos); }
// @cmember Inserisce una stringa
void insert_at(const char* s, int n);
// @cmember Toglie la stringa di posizione pos