linux/drivers/staging/speakup
Ben Hutchings 40fe4f8967 staging: speakup_soft: Fix reading of init string
softsynth_read() reads a character at a time from the init string;
when it finds the null terminator it sets the initialized flag but
then repeats the last character.

Additionally, if the read() buffer is not big enough for the init
string, the next read() will start reading from the beginning again.
So the caller may never progress to reading anything else.

Replace the simple initialized flag with the current position in
the init string, carried over between calls.  Switch to reading
real data once this reaches the null terminator.

(This assumes that the length of the init string can't change, which
seems to be the case.  Really, the string and position belong together
in a per-file private struct.)

Tested-by: Samuel Thibault <sthibault@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17 05:32:50 -07:00
..
buffers.c
DefaultKeyAssignments
devsynth.c
fakekey.c
i18n.c staging: speakup: i18n.c: Fix leak in msg_set() 2012-08-13 19:32:13 -07:00
i18n.h
Kconfig
keyhelp.c
kobjects.c
main.c Staging: speakup: fix an improperly-declared variable. 2012-06-18 17:13:06 -07:00
Makefile
selection.c staging: speakup: fixed checkpatch and sparse warnings in selection.c 2012-06-13 12:20:16 -07:00
serialio.c TTY: speakup, do not use serialP 2012-03-08 11:47:02 -08:00
serialio.h TTY: speakup, do not use serialP 2012-03-08 11:47:02 -08:00
speakup.h
speakup_acnt.h staging "speakup" Fix typos. 2012-07-09 13:06:21 -07:00
speakup_acntpc.c
speakup_acntsa.c
speakup_apollo.c
speakup_audptr.c
speakup_bns.c
speakup_decext.c
speakup_decpc.c staging "speakup" Fix typos. 2012-07-09 13:06:21 -07:00
speakup_dectlk.c
speakup_dtlk.c
speakup_dtlk.h
speakup_dummy.c
speakup_keypc.c
speakup_ltlk.c
speakup_soft.c staging: speakup_soft: Fix reading of init string 2012-09-17 05:32:50 -07:00
speakup_spkout.c
speakup_txprt.c
speakupmap.h
speakupmap.map
spk_priv.h TTY: speakup, do not use serialP 2012-03-08 11:47:02 -08:00
spk_priv_keyinfo.h
spk_types.h
spkguide.txt
synth.c staging "speakup" Fix typos. 2012-07-09 13:06:21 -07:00
thread.c
TODO
varhandlers.c