]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
virsh: avoid strncpy
authorEric Blake <eblake@redhat.com>
Tue, 29 May 2012 14:34:56 +0000 (08:34 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 29 May 2012 15:24:48 +0000 (09:24 -0600)
commitdc4301c7260b75856c389e51a8b0fb611900d0d2
treed717dd768434c9f0db020613b3030814388e4822
parente925ea3156f2cc8d57a29eeeb839202adc989391
virsh: avoid strncpy

strncpy is generally evil - it runs the risk of missing NUL
termination, and more often than not wastes time zeroing way
more bytes than strictly necessary.  We've avoided this evil
in our virStrncpy wrapper, except for places where we forgot
to use the wrapper; meanwhile, we have also added an even
higher layer wrapper for setting virTypedParameter values.

* tools/virsh.c (cmdMemtune, cmdBlkdeviotune): Use modern API.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Tighten.
cfg.mk
tools/virsh.c