/*
- * Copyright (C) 2012, 2013
+ * Copyright (C) 2012, 2013, 2014, 2015
* Dale Weiler
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
len = vsnprintf(buf, sizeof(buf), fmt, cpy);
va_end (cpy);
+ if (len < 0)
+ return len;
+
if (len < (int)sizeof(buf)) {
*dat = util_strdup(buf);
return len;