shithub: qk1

ref: 79050578c7fb0a2efc4c4d9c04ba63738fb5f660
dir: /seprint.c/

View raw version
#include "platform.h"

char *
seprint(char *buf, char *e, char *fmt, ...)
{
	va_list a;
	int n, m;

	if(e <= buf)
		return e;

	va_start(a, fmt);
	m = e-buf-1;
	n = vsnprintf(buf, m, fmt, a);
	va_end(a);

	return buf + (n < m ? n : m);
}