aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/accessibility/speakup/speakup_audptr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/accessibility/speakup/speakup_audptr.c')
-rw-r--r--drivers/accessibility/speakup/speakup_audptr.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/accessibility/speakup/speakup_audptr.c b/drivers/accessibility/speakup/speakup_audptr.c
index e89fd72579e6..4d16d60db9b2 100644
--- a/drivers/accessibility/speakup/speakup_audptr.c
+++ b/drivers/accessibility/speakup/speakup_audptr.c
@@ -6,7 +6,7 @@
* Copyright (C) 1998-99 Kirk Reiser.
* Copyright (C) 2003 David Borowski.
*
- * specificly written as a driver for the speakup screenreview
+ * specifically written as a driver for the speakup screenreview
* s not a general device driver.
*/
#include "spk_priv.h"
@@ -126,20 +126,22 @@ static void synth_flush(struct spk_synth *synth)
static void synth_version(struct spk_synth *synth)
{
- unsigned char test = 0;
- char synth_id[40] = "";
+ unsigned i;
+ char synth_id[33];
synth->synth_immediate(synth, "\x05[Q]");
- synth_id[test] = synth->io_ops->synth_in(synth);
- if (synth_id[test] == 'A') {
- do {
- /* read version string from synth */
- synth_id[++test] = synth->io_ops->synth_in(synth);
- } while (synth_id[test] != '\n' && test < 32);
- synth_id[++test] = 0x00;
+ synth_id[0] = synth->io_ops->synth_in(synth);
+ if (synth_id[0] != 'A')
+ return;
+
+ for (i = 1; i < sizeof(synth_id) - 1; i++) {
+ /* read version string from synth */
+ synth_id[i] = synth->io_ops->synth_in(synth);
+ if (synth_id[i] == '\n')
+ break;
}
- if (synth_id[0] == 'A')
- pr_info("%s version: %s", synth->long_name, synth_id);
+ synth_id[i] = '\0';
+ pr_info("%s version: %s", synth->long_name, synth_id);
}
static int synth_probe(struct spk_synth *synth)