diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/logfdisp.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/logfdisp.c b/apps/logfdisp.c index 2858fba566..2cfec2feb9 100644 --- a/apps/logfdisp.c +++ b/apps/logfdisp.c | |||
@@ -36,6 +36,7 @@ bool logfdisplay(void) | |||
36 | { | 36 | { |
37 | int w, h; | 37 | int w, h; |
38 | int lines; | 38 | int lines; |
39 | int columns; | ||
39 | int i; | 40 | int i; |
40 | int button; | 41 | int button; |
41 | 42 | ||
@@ -50,6 +51,14 @@ bool logfdisplay(void) | |||
50 | 0 | 51 | 0 |
51 | #endif | 52 | #endif |
52 | :LCD_HEIGHT)/h; | 53 | :LCD_HEIGHT)/h; |
54 | columns = (lcd? | ||
55 | #ifdef HAVE_REMOTE_LCD | ||
56 | LCD_REMOTE_WIDTH | ||
57 | #else | ||
58 | 0 | ||
59 | #endif | ||
60 | :LCD_WIDTH)/w; | ||
61 | |||
53 | if(!lines) | 62 | if(!lines) |
54 | return false; | 63 | return false; |
55 | 64 | ||
@@ -59,7 +68,7 @@ bool logfdisplay(void) | |||
59 | do { | 68 | do { |
60 | index = logfindex; | 69 | index = logfindex; |
61 | for(i = lines-1; i>=0; i--) { | 70 | for(i = lines-1; i>=0; i--) { |
62 | unsigned char buffer[MAX_LOGF_ENTRY + 1]; | 71 | unsigned char buffer[columns + 1]; |
63 | 72 | ||
64 | if(--index < 0) { | 73 | if(--index < 0) { |
65 | if(logfwrap) | 74 | if(logfwrap) |
@@ -68,8 +77,8 @@ bool logfdisplay(void) | |||
68 | break; /* done */ | 77 | break; /* done */ |
69 | } | 78 | } |
70 | 79 | ||
71 | memcpy(buffer, logfbuffer[index], MAX_LOGF_ENTRY); | 80 | memcpy(buffer, logfbuffer[index], columns); |
72 | buffer[MAX_LOGF_ENTRY]=0; | 81 | buffer[columns]=0; |
73 | lcd_puts(0, i, buffer); | 82 | lcd_puts(0, i, buffer); |
74 | } | 83 | } |
75 | lcd_update(); | 84 | lcd_update(); |