Better solution for issue #296

This commit is contained in:
Greg Ercolano 2021-11-24 15:13:04 -08:00
parent e97fd17e04
commit a900411ee2

View File

@ -51,7 +51,12 @@ Fl_Table_Row::CharVector::~CharVector() { // DTOR
} }
void Fl_Table_Row::CharVector::size(int count) { void Fl_Table_Row::CharVector::size(int count) {
if (count <= 0 ) count = 1; // (issue #296) if (count <= 0 ) { // Same state as init() - (issue #296)
if ( arr ) free(arr);
arr = 0;
_size = 0;
return;
}
if (count != _size) { if (count != _size) {
arr = (char*)realloc(arr, (unsigned)count * sizeof(char)); arr = (char*)realloc(arr, (unsigned)count * sizeof(char));
_size = count; _size = count;