[CRIU] Re: [PATCH] proc: Make sure eol remains on task name

Andrew Vagin avagin at parallels.com
Thu May 3 08:26:55 EDT 2012


> +
> +size_t strlcpy(char *dest, const char *src, size_t size)
> +{
> +	size_t ret = strlen(src);
> +
> +	if (size) {
> +		size_t len = (ret >= size) ? size - 1 : ret;
> +		memcpy(dest, src, len);
> +		dest[len] = '\0';
> +	}
	} else
		dest[0] = '\0';
Otherwise it's dangerous.
> +	return ret;
> +}
> -- 
> 1.7.7.6
> 

> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list