Date: Sat, 07 Jul 2018 14:08:44 -0700 From: Cy Schubert <Cy.Schubert@cschubert.com> To: =?utf-8?B?5b6M6Jek5aSn5Zyw?= <daichigoto@icloud.com> Cc: Hiroki Sato <hrs@FreeBSD.org>, daichi@FreeBSD.org, Eitan Adler <eadler@FreeBSD.org>, gnn@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336028 - head/usr.bin/top Message-ID: <201807072108.w67L8irC051381@slippy.cwsent.com> In-Reply-To: Message from =?utf-8?B?5b6M6Jek5aSn5Zyw?= <daichigoto@icloud.com> of "Sat, 07 Jul 2018 20:39:33 %2B0900." <EA13C9AB-808A-4FDA-B68F-57E832AF6449@icloud.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <EA13C9AB-808A-4FDA-B68F-57E832AF6449@icloud.com>, =?utf-8?B?5b6M6Je k5aSn5Zyw?= writes: > > > 2018/07/07 8:53、Hiroki Sato <hrs@FreeBSD.org>のメール: > > > > Daichi GOTO <daichi@FreeBSD.org> wrote > > in <201807061207.w66C76CR043533@repo.freebsd.org>: > > > > da> Author: daichi > > da> Date: Fri Jul 6 12:07:06 2018 > > da> New Revision: 336028 > > da> URL: https://svnweb.freebsd.org/changeset/base/336028 > > da> > > da> Log: > > da> Changed to eliminate the upper limit of command length displayed > > da> by "-a" and expand to match terminal width > > da> > > da> Reviewed by: eadler > > da> Approved by: gnn (mentor) > > da> Differential Revision: https://reviews.freebsd.org/D16083 > > da> > > da> Modified: > > da> head/usr.bin/top/display.c > > da> head/usr.bin/top/machine.c > > da> head/usr.bin/top/screen.c > > da> head/usr.bin/top/top.h > > > > This change breaks displaying a prompt and messages in the > > interactive mode by new_message() when typing "o" or "p", for > > example. While r336031 fixed a warning in GCC, it does not fix the > > problem itself. Please fix it. > > OK. I will fix this problem first. This should circumvent the problem until you find a more permanent fix. Index: /opt/src/svn-current/usr.bin/top/display.c =================================================================== --- /opt/src/svn-current/usr.bin/top/display.c (revision 336075) +++ /opt/src/svn-current/usr.bin/top/display.c (working copy) @@ -960,7 +960,7 @@ va_start(args, msgfmt); /* first, format the message */ - vsnprintf(next_msg, strlen(next_msg), msgfmt, args); + vsnprintf(next_msg, screen_width + 5, msgfmt, args); va_end(args); > > > > I also think restructure of the buffer management is required first > > if we want to eliminate the column width limitation. Using sbuf(9) > > consistently may be better than incomplete conversion from static > > arrays to malloc(). > > I understand. Switching to sbuf(9) is the next step. > > > > > -- Hiroki > > > -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807072108.w67L8irC051381>