From c3ce47deaeab20e267a0ca5354121c33339c7481 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 11 Aug 2018 13:55:09 +0200 Subject: layer23: Fix compiler warning about snprintf buffer too small MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gsm322.c:366:22: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=] sprintf(string, "-%d", 110 - rxlev); ^ gsm322.c:366:2: note: ‘sprintf’ output between 3 and 6 bytes into a destination of size 5 sprintf(string, "-%d", 110 - rxlev); Change-Id: I7b19fef89ba0cb0c1edbdd62c46ad8395e44145b --- src/host/layer23/src/mobile/gsm322.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/host/layer23/src') diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index 3bc8b5c8..a2cbb864 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -358,7 +358,7 @@ static int class_of_band(struct osmocom_ms *ms, int band) char *gsm_print_rxlev(uint8_t rxlev) { - static char string[5]; + static char string[6]; if (rxlev == 0) return "<=-110"; if (rxlev >= 63) -- cgit v1.2.3