]> git.ipfire.org Git - thirdparty/git.git/commit - fast-import.c
prefer memcpy to strcpy
authorJeff King <peff@peff.net>
Thu, 24 Sep 2015 21:08:19 +0000 (17:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Oct 2015 18:08:05 +0000 (11:08 -0700)
commit34fa79a6cde56d6d428ab0d3160cb094ebad3305
treed75524981f407be8af783b743df86f4a0e757d0e
parent4c9ac3bfaad9e32a7a98178d1f01779a3698144f
prefer memcpy to strcpy

When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more obvious that we are not going to
overflow the buffer (because the size we pass matches the
size in the allocation).

This also eliminates calls to strcpy, which make auditing
the code base harder.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/nedmalloc/nedmalloc.c
fast-import.c
revision.c