From: Andy Shevchenko Date: Tue, 9 Apr 2013 12:22:16 +0000 (+0300) Subject: staging: speakup: fix a bug when translate octal numbers X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3d2409d4f1d459ad734718ab19c731a934968ec0;p=linux-beck.git 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 Acked-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index be61a4ee78dd..0099cb12e560 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' &&