From owner-svn-src-head@freebsd.org Fri Jul 6 13:12:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E9901025E19; Fri, 6 Jul 2018 13:12:28 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from mr22p34im-asmtp001.me.com (mr22p34im-asmtp001.me.com [17.111.211.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C06FD80506; Fri, 6 Jul 2018 13:12:27 +0000 (UTC) (envelope-from daichigoto@icloud.com) Received: from process-dkim-sign-daemon.mr22p34im-asmtp001.me.com by mr22p34im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0PBG001004EBE500@mr22p34im-asmtp001.me.com>; Fri, 06 Jul 2018 13:12:20 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by mr22p34im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0PBG00KY04OD5000@mr22p34im-asmtp001.me.com>; Fri, 06 Jul 2018 13:12:20 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-07-06_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1807060147 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r336028 - head/usr.bin/top From: =?utf-8?B?5b6M6Jek5aSn5Zyw?= In-reply-to: <75ee54a3-1436-0e4c-57a7-8585ca12039e@freebsd.org> Date: Fri, 06 Jul 2018 22:12:13 +0900 Cc: Daichi GOTO , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: References: <201807061207.w66C76CR043533@repo.freebsd.org> <75ee54a3-1436-0e4c-57a7-8585ca12039e@freebsd.org> To: Sean Bruno X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 13:12:28 -0000 Surely. I think your advice is appropriate. Could you please commit? > 2018/07/06 22:04=E3=80=81Sean Bruno =E3=81=AE=E3=83=A1= =E3=83=BC=E3=83=AB: >=20 >=20 >=20 > On 07/06/18 06:07, Daichi GOTO wrote: >> -static char next_msg[MAX_COLS + 5]; >> +static char *next_msg =3D NULL; >> static int msglen =3D 0; >> /* Invariant: msglen is always the length of the message currently = displayed >> on the screen (even when next_msg doesn't contain that message). = */ >=20 > gcc noticed that a later call to vsnprintf() now has some problems. > /home/sbruno/bsd/wifi/fbsd_head/usr.bin/top/display.c: In function > 'new_message': > /home/sbruno/bsd/wifi/fbsd_head/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=3Dsizeof-pointer-memaccess] > vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); >=20 >=20 > I think this needs to be changed >=20 > Index: usr.bin/top/display.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.bin/top/display.c (revision 336029) > +++ usr.bin/top/display.c (working copy) > @@ -960,7 +960,7 @@ > va_start(args, msgfmt); >=20 > /* first, format the message */ > - vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); > + vsnprintf(next_msg, strlen(next_msg), msgfmt, args); >=20 > va_end(args); >=20