Re: [PATCH] sha1_name: use strlcpy() to copy strings

2015-02-23 Thread Jeff King
On Sun, Feb 22, 2015 at 11:33:16PM +0100, René Scharfe wrote: Am 22.02.2015 um 21:00 schrieb Junio C Hamano: René Scharfe l@web.de writes: Use strlcpy() instead of calling strncpy() and then setting the last byte of the target buffer to NUL explicitly. This shortens and simplifies the

Re: [PATCH] sha1_name: use strlcpy() to copy strings

2015-02-22 Thread René Scharfe
Am 22.02.2015 um 21:00 schrieb Junio C Hamano: René Scharfe l@web.de writes: Use strlcpy() instead of calling strncpy() and then setting the last byte of the target buffer to NUL explicitly. This shortens and simplifies the code a bit. Thanks. It makes me wonder if the longer term

Re: [PATCH] sha1_name: use strlcpy() to copy strings

2015-02-22 Thread Junio C Hamano
René Scharfe l@web.de writes: Use strlcpy() instead of calling strncpy() and then setting the last byte of the target buffer to NUL explicitly. This shortens and simplifies the code a bit. Thanks. It makes me wonder if the longer term direction should be not to use a bound buffer for

[PATCH] sha1_name: use strlcpy() to copy strings

2015-02-21 Thread René Scharfe
Use strlcpy() instead of calling strncpy() and then setting the last byte of the target buffer to NUL explicitly. This shortens and simplifies the code a bit. Signed-of-by: Rene Scharfe l@web.de --- sha1_name.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git