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:
William Hubbs 2008-10-04 12:43:40 -05:00
commit c8e2a35763

View file

@ -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();