Browse Source

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>
Andy Shevchenko 12 years ago
parent
commit
3d2409d4f1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/staging/speakup/varhandlers.c

+ 2 - 2
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' &&