diff --git a/softsynth.c b/softsynth.c index a5a324e..b366dc8 100644 --- a/softsynth.c +++ b/softsynth.c @@ -77,12 +77,6 @@ static int process_command(struct synth_t *s, char *buf, int start) } cp++; break; - case 24: - cmd = CMD_FLUSH; - stop_speech(); - queue_clear(); - cp++; - break; default: cmd = CMD_UNKNOWN; cp++; @@ -168,16 +162,16 @@ void main_loop (struct synth_t *s) perror("Read from softsynth failed"); break; } - for(i = length; i > 0; i--) + *(buf+length) = 0; + for(i = length; i >= 0; i--) if (*(buf+i) == 0x18) { /* synth flush char. */ queue_clear(); stop_speech(); j = length-i; - for(length = 0; length < j; length++) + for(length = 0; length <= j; length++) *(buf+length) = *(buf+i++); break; } - *(buf+length) = 0; process_buffer (s, buf, length); } }