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>
This commit is contained in:
Andy Shevchenko 2013-04-09 15:22:16 +03:00 committed by Greg Kroah-Hartman
parent de68600e32
commit 3d2409d4f1
1 changed files with 2 additions and 2 deletions

View File

@ -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' &&