/* The return value is the number of characters written into @buf not including the trailing '\0'. If @size is <= 0 the function returns 0.  */
int scnprintf(char *buf, size_t size, const char *fmt,...)
/* The return value is the number of characters written into @buf not including the trailing '\0'. If @size is <= 0 the function returns 0.  */
int scnprintf(char *buf, size_t size, const char *fmt,...)
{
	va_list args;
	int i;
	va_start(args, fmt);
	i = vsnprintf(buf, size, fmt, args);
	va_end(args);
	return (i >= size) ? (size - 1) : i;
}