diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/keyboard.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index d6a76d7b08..060393c269 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c | |||
@@ -157,7 +157,7 @@ static const unsigned char morse_codes[] = { | |||
157 | int load_kbd(unsigned char* filename) | 157 | int load_kbd(unsigned char* filename) |
158 | { | 158 | { |
159 | int fd, l; | 159 | int fd, l; |
160 | int i = 0, line_len, max_line_len; | 160 | int i, line_len, max_line_len; |
161 | unsigned char buf[4]; | 161 | unsigned char buf[4]; |
162 | 162 | ||
163 | if (filename == NULL) | 163 | if (filename == NULL) |
@@ -171,7 +171,8 @@ int load_kbd(unsigned char* filename) | |||
171 | return 1; | 171 | return 1; |
172 | 172 | ||
173 | line_len = 0; | 173 | line_len = 0; |
174 | max_line_len = 0; | 174 | max_line_len = 1; |
175 | i = 0; | ||
175 | while (read(fd, buf, 1) == 1 && i < KBD_BUF_SIZE) | 176 | while (read(fd, buf, 1) == 1 && i < KBD_BUF_SIZE) |
176 | { | 177 | { |
177 | /* check how many bytes to read for this character */ | 178 | /* check how many bytes to read for this character */ |
@@ -215,6 +216,9 @@ int load_kbd(unsigned char* filename) | |||
215 | close(fd); | 216 | close(fd); |
216 | kbd_loaded = true; | 217 | kbd_loaded = true; |
217 | 218 | ||
219 | if (max_line_len < line_len) | ||
220 | max_line_len = line_len; | ||
221 | |||
218 | FOR_NB_SCREENS(l) | 222 | FOR_NB_SCREENS(l) |
219 | { | 223 | { |
220 | struct keyboard_parameters *pm = &kbd_param[l]; | 224 | struct keyboard_parameters *pm = &kbd_param[l]; |
@@ -948,6 +952,8 @@ static void kbd_calc_params(struct keyboard_parameters *pm, | |||
948 | i++; | 952 | i++; |
949 | } | 953 | } |
950 | } | 954 | } |
955 | if (pm->nchars == 0) | ||
956 | pm->kbd_buf[pm->nchars++] = ' '; | ||
951 | 957 | ||
952 | /* calculate pm->pages and pm->lines */ | 958 | /* calculate pm->pages and pm->lines */ |
953 | sc_h = sc->getheight(); | 959 | sc_h = sc->getheight(); |