wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

strlcatprint.c (381B)


      1 /* Copyright ©2008-2010 Kris Maglione <maglione.k at Gmail>
      2  * See LICENSE file for license details.
      3  */
      4 #include <string.h>
      5 #include <fmt.h>
      6 #include "util.h"
      7 
      8 int
      9 strlcatprint(char *buf, int len, const char *fmt, ...) {
     10 	va_list ap;
     11 	int buflen;
     12 	int ret;
     13 
     14 	va_start(ap, fmt);
     15 	buflen = strlen(buf);
     16 	ret = vsnprint(buf+buflen, len-buflen, fmt, ap);
     17 	va_end(ap);
     18 	return ret;
     19 }