Merge branch 'master' into jgrpp

# Conflicts:
#	src/industry_cmd.cpp
#	src/landscape.cpp
#	src/object_cmd.cpp
#	src/rail_cmd.cpp
#	src/script/api/script_tile.cpp
#	src/table/settings/difficulty_settings.ini
#	src/table/settings/world_settings.ini
#	src/terraform_cmd.cpp
#	src/tilearea_type.h
#	src/tree_cmd.cpp
#	src/tree_cmd.h
#	src/tree_gui.cpp
#	src/water_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2023-01-14 16:40:24 +00:00
16 changed files with 62 additions and 53 deletions

View File

@@ -371,13 +371,11 @@ bool Textbuf::MovePos(uint16 keycode)
* @param max_chars maximum size in chars, including terminating '\0'
*/
Textbuf::Textbuf(uint16 max_bytes, uint16 max_chars)
: buf(MallocT<char>(max_bytes))
: buf(MallocT<char>(max_bytes)), char_iter(StringIterator::Create())
{
assert(max_bytes != 0);
assert(max_chars != 0);
this->char_iter = StringIterator::Create();
this->afilter = CS_ALPHANUMERAL;
this->max_bytes = max_bytes;
this->max_chars = max_chars == UINT16_MAX ? max_bytes : max_chars;
@@ -387,7 +385,6 @@ Textbuf::Textbuf(uint16 max_bytes, uint16 max_chars)
Textbuf::~Textbuf()
{
delete this->char_iter;
free(this->buf);
}