aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/libdebug/debug.c2
-rw-r--r--src/libdisplay/display_iq.c4
-rw-r--r--src/libdisplay/display_measurements.c2
-rw-r--r--src/libdisplay/display_spectrum.c6
-rw-r--r--src/libdisplay/display_status.c2
-rw-r--r--src/libdisplay/display_wave.c4
6 files changed, 16 insertions, 4 deletions
diff --git a/src/libdebug/debug.c b/src/libdebug/debug.c
index 771fa55..5763f4f 100755
--- a/src/libdebug/debug.c
+++ b/src/libdebug/debug.c
@@ -101,8 +101,6 @@ void get_win_size(int *w, int *h)
*h = win.ws_row;
*w = win.ws_col;
- if (*w > MAX_DISPLAY_WIDTH - 1)
- *w = MAX_DISPLAY_WIDTH - 1;
}
void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, const char *kanal, const char *fmt, ...)
diff --git a/src/libdisplay/display_iq.c b/src/libdisplay/display_iq.c
index 303706a..a16594f 100644
--- a/src/libdisplay/display_iq.c
+++ b/src/libdisplay/display_iq.c
@@ -54,6 +54,8 @@ void display_iq_on(int on)
int w, h;
get_win_size(&w, &h);
+ if (w > MAX_DISPLAY_WIDTH - 1)
+ w = MAX_DISPLAY_WIDTH - 1;
if (iq_on) {
memset(&screen, ' ', sizeof(screen));
@@ -113,6 +115,8 @@ void display_iq(float *samples, int length)
return;
get_win_size(&width, &h);
+ if (width > MAX_DISPLAY_WIDTH - 1)
+ width = MAX_DISPLAY_WIDTH - 1;
/* at what line we draw our zero-line and what character we use */
x_center = width >> 1;
diff --git a/src/libdisplay/display_measurements.c b/src/libdisplay/display_measurements.c
index d22e4ff..c8329ef 100644
--- a/src/libdisplay/display_measurements.c
+++ b/src/libdisplay/display_measurements.c
@@ -102,6 +102,8 @@ static void print_measurements(int on)
int bar_width, bar_left, bar_right, bar_hold, bar_mark;
get_win_size(&width, &h);
+ if (width > MAX_DISPLAY_WIDTH - 1)
+ width = MAX_DISPLAY_WIDTH - 1;
/* no display, if bar graph is less than one character */
bar_width = width - MAX_NAME_LEN - MAX_UNIT_LEN;
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;
diff --git a/src/libdisplay/display_status.c b/src/libdisplay/display_status.c
index c15b88b..5205159 100644
--- a/src/libdisplay/display_status.c
+++ b/src/libdisplay/display_status.c
@@ -37,6 +37,8 @@ static void print_status(int on)
int w, h;
get_win_size(&w, &h);
+ if (w > MAX_DISPLAY_WIDTH - 1)
+ w = MAX_DISPLAY_WIDTH - 1;
if (w > MAX_DISPLAY_WIDTH)
w = MAX_DISPLAY_WIDTH;
diff --git a/src/libdisplay/display_wave.c b/src/libdisplay/display_wave.c
index 261c5bb..8932960 100644
--- a/src/libdisplay/display_wave.c
+++ b/src/libdisplay/display_wave.c
@@ -47,6 +47,8 @@ void display_wave_on(int on)
int w, h;
get_win_size(&w, &h);
+ if (w > MAX_DISPLAY_WIDTH - 1)
+ w = MAX_DISPLAY_WIDTH - 1;
if (wave_on) {
memset(&screen, ' ', sizeof(screen));
@@ -101,6 +103,8 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
return;
get_win_size(&width, &h);
+ if (width > MAX_DISPLAY_WIDTH - 1)
+ width = MAX_DISPLAY_WIDTH - 1;
/* at what line we draw our zero-line and what character we use */
center_line = (HEIGHT - 1) >> 1;