[BUG] wprintf(L"%s", str) expects str to be wide
Eric Blake
eblake@redhat.com
Fri Jan 11 17:45:00 GMT 2013
On 01/11/2013 10:02 AM, Craig Howland wrote:
> Looks good. (Good catch on the case 'x', too.) One very minor
> thing, to be very gung-ho, should you care to bother:
>
> insize = p ? p - arg : prec; // works
>
> insize = (p!=NULL) ? p - arg : prec; // cleaner
Pointless waste of typing.
>
> (There's tons of the former, of course, and realistically NULL will
> never be other than 0.)
Even if NULL is not 0 (which the C standard does allow, after all), the
C standard still requires that the conversion of a pointer to boolean
context treats all non-NULL pointers as true, and a null pointer as
false, so you are not buying any robustness by adding an explicit
comparison to NULL.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/newlib/attachments/20130111/b999bc15/attachment.sig>
More information about the Newlib
mailing list