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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 22.02.2015 um 21:00 schrieb Junio C Hamano:
René Scharfe <l.s.r@xxxxxx> 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 oc->path, though.

That's a good idea in general, but a bit more involved since we'd need to introduce a cleanup function that releases the memory allocated by the new version of get_sha1_with_context() first and call it from the appropriate places.

Would that be a good micro-project for GSoC or is it too simple?

René
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]