diff options
-rw-r--r-- | drivers/staging/speakup/main.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index ef5933b93590..3b6e5358c723 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c | |||
@@ -1855,8 +1855,9 @@ static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key) | |||
1855 | { | 1855 | { |
1856 | static u_char goto_buf[8]; | 1856 | static u_char goto_buf[8]; |
1857 | static int num; | 1857 | static int num; |
1858 | int maxlen, go_pos; | 1858 | int maxlen; |
1859 | char *cp; | 1859 | char *cp; |
1860 | |||
1860 | if (type == KT_SPKUP && ch == SPEAKUP_GOTO) | 1861 | if (type == KT_SPKUP && ch == SPEAKUP_GOTO) |
1861 | goto do_goto; | 1862 | goto do_goto; |
1862 | if (type == KT_LATIN && ch == '\n') | 1863 | if (type == KT_LATIN && ch == '\n') |
@@ -1891,25 +1892,24 @@ oops: | |||
1891 | spk_special_handler = NULL; | 1892 | spk_special_handler = NULL; |
1892 | return 1; | 1893 | return 1; |
1893 | } | 1894 | } |
1894 | go_pos = kstrtol(goto_buf, 10, (long *)&cp); | 1895 | |
1895 | goto_pos = (u_long) go_pos; | 1896 | goto_pos = simple_strtoul(goto_buf, &cp, 10); |
1897 | |||
1896 | if (*cp == 'x') { | 1898 | if (*cp == 'x') { |
1897 | if (*goto_buf < '0') | 1899 | if (*goto_buf < '0') |
1898 | goto_pos += spk_x; | 1900 | goto_pos += spk_x; |
1899 | else | 1901 | else if (goto_pos > 0) |
1900 | goto_pos--; | 1902 | goto_pos--; |
1901 | if (goto_pos < 0) | 1903 | |
1902 | goto_pos = 0; | ||
1903 | if (goto_pos >= vc->vc_cols) | 1904 | if (goto_pos >= vc->vc_cols) |
1904 | goto_pos = vc->vc_cols - 1; | 1905 | goto_pos = vc->vc_cols - 1; |
1905 | goto_x = 1; | 1906 | goto_x = 1; |
1906 | } else { | 1907 | } else { |
1907 | if (*goto_buf < '0') | 1908 | if (*goto_buf < '0') |
1908 | goto_pos += spk_y; | 1909 | goto_pos += spk_y; |
1909 | else | 1910 | else if (goto_pos > 0) |
1910 | goto_pos--; | 1911 | goto_pos--; |
1911 | if (goto_pos < 0) | 1912 | |
1912 | goto_pos = 0; | ||
1913 | if (goto_pos >= vc->vc_rows) | 1913 | if (goto_pos >= vc->vc_rows) |
1914 | goto_pos = vc->vc_rows - 1; | 1914 | goto_pos = vc->vc_rows - 1; |
1915 | goto_x = 0; | 1915 | goto_x = 0; |