mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-25 03:32:01 +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:
parent
2d02c23574
commit
0c037627fc
@ -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) {
|
||||
|
@ -51,7 +51,6 @@ class TypeRecipient: public Typer::Delegate {
|
||||
|
||||
void typer_reset(Typer *typer) {
|
||||
clear_all_keys();
|
||||
typer_.reset();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user