From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9226 invoked by alias); 26 Jul 2006 22:36:03 -0000 Received: (qmail 9216 invoked by uid 22791); 26 Jul 2006 22:36:03 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Jul 2006 22:36:00 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k6QMY6Zk022376; Thu, 27 Jul 2006 00:34:06 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k6QMY6vP029990; Thu, 27 Jul 2006 00:34:06 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k6QMY6v8028563; Thu, 27 Jul 2006 00:34:06 +0200 (CEST) Date: Wed, 26 Jul 2006 22:36:00 -0000 Message-Id: <200607262234.k6QMY6v8028563@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: vladimir@codesourcery.com, gdb-patches@sources.redhat.com In-reply-to: <20060726222546.GA29930@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 26 Jul 2006 18:25:46 -0400) Subject: Re: [PATCH] zero-terminate result of target_read_alloc 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> <20060726222546.GA29930@nevyn.them.org> 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/msg00395.txt.bz2 > Date: Wed, 26 Jul 2006 18:25:46 -0400 > From: Daniel Jacobowitz > > 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? Sure