+/* ssnprintf returns zero on success, one if truncation occurred
+ and a negative integer onerror. */
+static int _ssnprintf(char *str, size_t sz, const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+
+ int ret = vsnprintf(str, sz, format, ap);
+
+ va_end(ap);
+
+ if (ret < 0) {
+ return ret;
+ }
+ return (size_t)ret >= sz;
+} /* int _ssnprintf */
+