Re: [RFC 2/2] Git-over-TLS (gits://) client side support (part 2 of 2)
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Jan 13, 2010, 13:25 UTC
- Message-ID
- <81b0412b1001130525j63f5879bx657436b418b128df@mail.gmail.com>
- In-Reply-To
- <1263388786-6880-3-git-send-email-ilari.liusvaara@elisanet.fi>
On Wed, Jan 13, 2010 at 14:19, Ilari Liusvaara <ilari.liusvaara@elisanet.fi> wrote:
Show 9 quoted lines
> +char *copy_alloc(const char *str, size_t len)
> +{
> + char *copy;
> +
> + copy = xmalloc(len + 1);
> + copy[len] = 0;
> + strncpy(copy, str, len);
> + return copy;
> +}Some know this code as strndup(3):
http://linux.die.net/man/3/strndup