fix flush processing

This removes flush processing from process_command() and fixes
the code in the main loop so that it does not ignore the 0 position
in the buffer.
This commit is contained in:
William Hubbs 2008-08-31 10:29:00 -05:00
commit 96a3b19850

View file

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