diff --git a/src/include/strings.cpp b/src/include/strings.cpp index 4b50b9cb0..36f27858d 100755 --- a/src/include/strings.cpp +++ b/src/include/strings.cpp @@ -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(); diff --git a/src/include/strings.h b/src/include/strings.h index ad9953e08..1b12795ee 100755 --- a/src/include/strings.h +++ b/src/include/strings.h @@ -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