]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
r336028 changed next_msg to a char * from char [] of fixed size. Change
authorsbruno <sbruno@FreeBSD.org>
Fri, 6 Jul 2018 13:22:44 +0000 (13:22 +0000)
committersbruno <sbruno@FreeBSD.org>
Fri, 6 Jul 2018 13:22:44 +0000 (13:22 +0000)
commit3ac162d0a411905dbc07c76d30fad29250770084
tree55d9dcfca1178f427e0c6a49b683e026afda03a8
parent41f6591bd5a88d1bb5e1d7b2254495caac07309e
r336028 changed next_msg to a char * from char [] of fixed size.  Change
2nd argument of vsnprintf() to get the strlen of next_msg so that the
appropriate size is used.

Found with gcc.

/usr.bin/top/display.c: In function 'new_message':
/usr.bin/top/display.c:963:31: error:
argument to 'sizeof' in 'vsnprintf' call is the same expression as the
destination; did you mean to provide an explicit length?
[-Werror=sizeof-pointer-memaccess]
     vsnprintf(next_msg, sizeof(next_msg), msgfmt, args);

Reviewed by: daichi
usr.bin/top/display.c