bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The patch of glibc which allows the user to override the pfinet serv


From: olafBuddenhagen
Subject: Re: The patch of glibc which allows the user to override the pfinet server
Date: Fri, 15 Aug 2008 01:26:40 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi,

On Wed, Aug 13, 2008 at 01:49:41PM +0200, zhengda wrote:
> Neal H. Walfield wrote:

>> Check if the result is != -1, not > 0, which has a different meaning.
>>
>>>>> +          if (__asprintf (&name, "%s/%d", sock_servs, domain) > 0)
>>>>> +              np = name;
>>   
> but it's still wrong that __asprintf returns 0 in my code, isn't it?

There is no way asprintf() could return 0 here. (Unless there is an
internal error, in which case we loose anyways...)

Thus the >0 instead of !=-1 test doesn't actually hurt in a technical
sense -- it just has no effect at all; and this is confusing IMHO.

-antrik-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]