From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBpsu-0005v4-S4 for qemu-devel@nongnu.org; Sun, 14 Dec 2008 07:15:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBpst-0005sz-0n for qemu-devel@nongnu.org; Sun, 14 Dec 2008 07:15:44 -0500 Received: from [199.232.76.173] (port=44386 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBpss-0005sm-RW for qemu-devel@nongnu.org; Sun, 14 Dec 2008 07:15:42 -0500 Received: from mail-bw0-f12.google.com ([209.85.218.12]:47615) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBpss-0001Vh-Eo for qemu-devel@nongnu.org; Sun, 14 Dec 2008 07:15:42 -0500 Received: by bwz5 with SMTP id 5so3639213bwz.10 for ; Sun, 14 Dec 2008 04:15:41 -0800 (PST) Message-ID: Date: Sun, 14 Dec 2008 14:15:41 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] [6023] Use a hex value instead of possibly ambiguous 8 bit character In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Johannes Schindelin Cc: Andreas Schwab , qemu-devel@nongnu.org On 12/14/08, Johannes Schindelin wrote: > Hi, > > > Please Cc: me, I only did not miss your message because it is a slow > Sunday morning (_and_ I am not in a deep hacking session). > > > > > On Sun, 14 Dec 2008, Andreas Schwab wrote: > > > Johannes Schindelin writes: > > > > > +#define ADD_CHAR(c) buffer[j++] = (c) ? '.' : (c) > > > Oops. This is obviously wrong, and should read > > > #define ADD_CHAR(c) buffer[j++] = (c) < ' ' ? '.' : (c) > > > isprint(c) perhaps? > > > I vote against using isprint(c). The code is simple as it is, otherwise > you'd have to look up what isprint() does, _and_ rely on isprint() being > present. I agree that we should not use plain old isprint, but instead the highly advanced, omnipresent qemu_isprint which has none of the problems of what isprint may have. ;-)