staging: speakup: fix a bug when translate octal numbers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 9 Apr 2013 12:22:16 +0000 (15:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2013 19:36:43 +0000 (12:36 -0700)
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>
drivers/staging/speakup/varhandlers.c

index be61a4ee78dd4bd3ca26c9e493a9e25c207c6e29..0099cb12e56065291144e74ee9c13d27ea17f6ff 100644 (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' &&
This page took 0.026976 seconds and 5 git commands to generate.