Switch/ext/ebtree/ebtree/common/chunk.h
static inline int chunk_strcpy(struct chunk *chk, const char *str)
{
	size_t len;

	len = strlen(str);

	if (unlikely(len >= chk->size))
		return 0;

	chk->len  = len;
	memcpy(chk->str, str, len + 1);

	return 1;
}
/* copies str into <chk> followed by a trailing zero. Returns 0 in
 * case of failure.
 */
copies str into  followed by a trailing zero. Returns 0 in
case of failure.
copies str into followed by a trailing zero . Returns 0 in case of failure .
static inline int chunk_strcpy(struct chunk *chk, const char *str)
{
	size_t len;
	len = strlen(str);
	if (unlikely(len >= chk->size))
		return 0;
	chk->len  = len;
	memcpy(chk->str, str, len + 1);
	return 1;
}
static inline int chunk_strcpy ( struct chunk * chk , const char * str ) { size_t len ; len = strlen ( str ) ; if ( unlikely ( len >= chk -> size ) ) return 0 ; chk -> len = len ; memcpy ( chk -> str , str , len + 1 ) ; return 1 ; }
copies str into <chk> followed by a trailing zero.
copies str into <chk > followed by a trailing zero .