aboutsummaryrefslogtreecommitdiffstats
path: root/src/libdisplay/display_spectrum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdisplay/display_spectrum.c')
-rw-r--r--src/libdisplay/display_spectrum.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libdisplay/display_spectrum.c b/src/libdisplay/display_spectrum.c
index c2fc1c3..a85da76 100644
--- a/src/libdisplay/display_spectrum.c
+++ b/src/libdisplay/display_spectrum.c
@@ -95,6 +95,8 @@ void display_spectrum_on(int on)
int w, h;
get_win_size(&w, &h);
+ if (w > MAX_DISPLAY_WIDTH - 1)
+ w = MAX_DISPLAY_WIDTH - 1;
if (spectrum_on) {
memset(&screen, ' ', sizeof(screen));
@@ -139,8 +141,8 @@ void display_spectrum(float *samples, int length)
return;
get_win_size(&width, &h);
- if (width > MAX_DISPLAY_WIDTH)
- width = MAX_DISPLAY_WIDTH;
+ if (width > MAX_DISPLAY_WIDTH - 1)
+ width = MAX_DISPLAY_WIDTH - 1;
/* calculate size of FFT */
int m, fft_size = 0, fft_taps = 0;