From: "Jan Beulich" Subject: Re: [PATCH v7 5/9] Add an implentation of asprintf() for xen Date: Fri, 09 May 2014 16:47:25 +0100 Message-ID: <536D14AD0200007800011090@mail.emea.novell.com> References: <1399624804-5109-1-git-send-email-paul.durrant@citrix.com> <1399624804-5109-6-git-send-email-paul.durrant@citrix.com> <536CEF130200007800010F01@mail.emea.novell.com> <9AAE0902D5BC7E449B7C8E4E778ABCD034DBFD@AMSPEX01CL01.citrite.net> <536CF1150200007800010F2B@mail.emea.novell.com> <9AAE0902D5BC7E449B7C8E4E778ABCD034DDB6@AMSPEX01CL01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD034DDB6@AMSPEX01CL01.citrite.net> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant Cc: Ian Jackson , "Tim (Xen.org)" , "Keir (Xen.org)" , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 09.05.14 at 16:15, wrote: >> From: Jan Beulich [mailto:JBeulich@suse.com] >> >>> On 09.05.14 at 15:08, wrote: >> >> From: Jan Beulich [mailto:JBeulich@suse.com] >> >> >>> On 09.05.14 at 10:40, wrote: >> >> > +int vasprintf(char **bufp, const char *fmt, va_list args) >> >> > +{ >> >> > + va_list args_copy; >> >> > + size_t size; >> >> > + char *buf, dummy[1]; >> >> > + >> >> > + va_copy(args_copy, args); >> >> > + size = vsnprintf(dummy, 0, fmt, args_copy); >> >> >> >> Hmm, this is still dummy rather than NULL. >> > >> > Yes, I explained why - I thought you were ok with that. >> >> No, I wasn't - the argument was rather weak: If we had a problem >> with NULL in vsnprintf() then we ought to fix it rather than working >> around. > > We do have a problem. Crashed immediately. Urgh. Jan