chiark / gitweb /
replace strncpy() with strlcpy()
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Tue, 21 Oct 2008 21:42:15 +0000 (22:42 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 21 Oct 2008 21:55:13 +0000 (23:55 +0200)
commit111e4f81ff057fd5869d152a503ad982e2116f85
tree5b8548f6c41f3b58ff615b43b8cfc76124ade155
parent9a23e9e7754027775f62baec847b46703e20d166
replace strncpy() with strlcpy()

The problem was strncpy() doesn't stop after writing the terminating
NUL; by definition it goes on to zero the entire buffer.

I spy another use of strncpy in udev_device_add_property_from_string(),
which is responsible for another ~1% user cpu time...

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
extras/scsi_id/scsi_id.c
udev/lib/libudev-device.c