layer23: Fix compiler warning about snprintf buffer too small
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
This commit is contained in:
parent
82d8370f62
commit
c3ce47deae
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue