[dm-devel] [PATCH v2 45/72] libmultipath: fix -Wsign-compare warnings with snprintf()

Bart Van Assche bvanassche at acm.org
Fri Oct 25 02:51:43 UTC 2019


On 2019-10-24 08:06, Martin Wilck wrote:
> +#define safe_snprintf(var, size, format, args...)			\
> +	({								\
> +		size_t __size = size;					\
> +		int __ret;						\
> +									\
> +		__ret = snprintf(var, size, format, ##args);		\
> +		__ret < 0 || (size_t)__ret >= __size;			\
> +	})

How about adding a comment that explains the meaning of the returned
value? Otherwise this patch looks fine to me. Thank you for having done
this rework.

Bart.




More information about the dm-devel mailing list