mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-23 08:04:18 +02:00
fixed an off-by-one error
The loop can start at length-1 since we know that the last character in the buffer is a null. Thanks again to Chris Brannon for finding this.
This commit is contained in:
parent
f76d00f6af
commit
c8e2a35763
1 changed files with 2 additions and 1 deletions
|
|
@ -163,7 +163,8 @@ void main_loop(struct synth_t *s)
|
|||
break;
|
||||
}
|
||||
*(buf + length) = 0;
|
||||
for (i = length; i >= 0; i--)
|
||||
/* *(buf+length) is not 0x18 */
|
||||
for (i = length - 1; i >= 0; i--)
|
||||
if (*(buf + i) == 0x18) { /* synth flush char. */
|
||||
queue_clear();
|
||||
stop_speech();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue