Commit 3d2409d4 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent de68600e
......@@ -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' &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment