On 01/26/2012 01:56 AM, Michal Privoznik wrote: > On 26.01.2012 01:51, Eric Blake wrote: >> Using snprintf to build up argv seems archaic. >> >> * daemon/remote.c (remoteDispatchAuthPolkit): Modernize command call. >> --- >> daemon/remote.c | 42 +++++++++++++++++------------------------- >> 1 files changed, 17 insertions(+), 25 deletions(-) >> > > ACK. I wonder if we should force developers to use virAsnprintf() > instead of snprintf() like we already do for malloc(), realloc(), etc. Series pushed. There are still some valid uses of snprintf (in situations like generating a unix socket name into a fixed-width structure), so I don't think we can outright forbid it. But yes, there's quite a few places where dynamic sizing makes the code easier to write. -- Eric Blake eblake@xxxxxxxxxx +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list