Thread (8 messages) flat view 8 messages, 5 authors, 2016-06-15

Re: [PATCH 1/5] Make xstrndup common

From: Jeff King <hidden>
Date: 2016-06-15 22:43:07

On Mon, Apr 30, 2007 at 03:12:50PM +0200, Johannes Schindelin wrote:
Unless I am missing something, I think this should work:

static inline char *xstrndup(const char *str, int len)
{
	char *result = strndup(str, len);
	if (result == NULL)
		die ("xstrndup(): out of memory");
	return result;
}

Hmm?
I can't speak for the original authors, but I imagine part of the
impetus was that strndup is a GNU-ism.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help