From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3490 invoked by alias); 26 Jul 2006 22:25:52 -0000 Received: (qmail 3479 invoked by uid 22791); 26 Jul 2006 22:25:52 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 26 Jul 2006 22:25:50 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1G5rp4-0007nb-KQ; Wed, 26 Jul 2006 18:25:46 -0400 Date: Wed, 26 Jul 2006 22:25:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: vladimir@codesourcery.com, gdb-patches@sources.redhat.com Subject: Re: [PATCH] zero-terminate result of target_read_alloc Message-ID: <20060726222546.GA29930@nevyn.them.org> Mail-Followup-To: Mark Kettenis , vladimir@codesourcery.com, gdb-patches@sources.redhat.com References: <200607181356.16071.vladimir@codesourcery.com> <24758.192.87.1.22.1153221922.squirrel@webmail.xs4all.nl> <20060724040937.GA24339@nevyn.them.org> <200607242138.k6OLcP7h023940@elgar.sibelius.xs4all.nl> <20060724220043.GB18918@nevyn.them.org> <200607262151.k6QLpOLX018719@elgar.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200607262151.k6QLpOLX018719@elgar.sibelius.xs4all.nl> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00394.txt.bz2 On Wed, Jul 26, 2006 at 11:51:24PM +0200, Mark Kettenis wrote: > > Date: Mon, 24 Jul 2006 18:00:43 -0400 > > From: Daniel Jacobowitz > > > > All right! Compromise and progress! Thanks, Mark. > > > > How about this patch (untested so far)? My only concern is that it > > doesn't report error/unsupported separately from empty; but for all the > > uses I know of so far, that's not a problem, and we can change it later > > if we need to. > > Better get this right from the start, and return xstrdup("") for > "empty". Also the error message ... Why didn't I think of that? Brilliant! > "... contained unexpected zero bytes" > > is not very clear; the first time I thought that would warn about > returning an empty string. How about changing that to > > "... contained unexpected null characters" > > ? > > The C standard uses the term "null character" for a byte with all bits > set to 0. That works for me. OK with those changes? -- Daniel Jacobowitz CodeSourcery