1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00

Typer fixes: the recipient no longer releases the caller, and a duplicate call to strlen and piece of arithmetic is corrected.

This commit is contained in:
Thomas Harte 2017-07-06 21:17:04 -04:00
parent 2d02c23574
commit 0c037627fc
2 changed files with 1 additions and 2 deletions

View File

@ -15,7 +15,7 @@ Typer::Typer(const char *string, int delay, int frequency, Delegate *delegate) :
counter_(-delay), frequency_(frequency), string_pointer_(0), delegate_(delegate), phase_(0) {
size_t string_size = strlen(string) + 3;
string_ = (char *)malloc(string_size);
snprintf(string_, strlen(string) + 3, "%c%s%c", Typer::BeginString, string, Typer::EndString);
snprintf(string_, string_size, "%c%s%c", Typer::BeginString, string, Typer::EndString);
}
void Typer::update(int duration) {

View File

@ -51,7 +51,6 @@ class TypeRecipient: public Typer::Delegate {
void typer_reset(Typer *typer) {
clear_all_keys();
typer_.reset();
}
protected: