diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-04-09 15:22:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-09 12:36:43 -0700 |
commit | 3d2409d4f1d459ad734718ab19c731a934968ec0 (patch) | |
tree | 1d717cb0c5e663e17807fc44eccaa23677571de1 /drivers/staging/speakup/varhandlers.c | |
parent | de68600e32fa713544a2dde68dac783411405b46 (diff) |
staging: speakup: fix a bug when translate octal numbers
There are actually overflow bug and typo. And bug was never happened due to the
typo.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup/varhandlers.c')
-rw-r--r-- | drivers/staging/speakup/varhandlers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index be61a4ee78d..0099cb12e56 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -344,9 +344,9 @@ char *spk_xlate(char *s) p1++; } else if (*p1 >= '0' && *p1 <= '7') { num = (*p1++)&7; - while (num < 256 && *p1 >= '0' && *p1 <= '7') { + while (num < 32 && *p1 >= '0' && *p1 <= '7') { num <<= 3; - num = (*p1++)&7; + num += (*p1++)&7; } *p++ = num; } else if (*p1 == 'x' && |