mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-22 09:40:25 +01:00
Use alloc_c_string() to convert String to char*
Using get_data() would sometimes result in the wrong data being written. Fixes #12
This commit is contained in:
parent
43df7d5331
commit
399acf00c7
2 changed files with 5 additions and 3 deletions
|
@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Positioned background rect at 0,0 so it is no longer offset if a margin is added when Terminal is a child of a Container node.
|
||||
- Removed all pre-compiled binaries using BFG [Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/), thus re-writing git history.
|
||||
|
||||
### Fixed
|
||||
- Fixed #12 where incorrect data would sometimes be written to the terminal when passing a string to the Terminal's `write()` method.
|
||||
|
||||
## [1.0.0] - 2020-10-05
|
||||
### Added
|
||||
- Changelog.
|
||||
|
|
|
@ -585,9 +585,8 @@ void Terminal::write(Variant data)
|
|||
case Variant::Type::STRING:
|
||||
{
|
||||
String string = data;
|
||||
CharString utf8 = string.utf8();
|
||||
u8 = utf8.get_data();
|
||||
len = utf8.length();
|
||||
u8 = string.alloc_c_string();
|
||||
len = strlen(u8);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue