summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/output.c b/src/output.c
index 4d3b4c2..34243ea 100644
--- a/src/output.c
+++ b/src/output.c
@@ -286,7 +286,7 @@ fmtstr(char *outbuf, size_t length, const char *fmt, ...)
 	va_start(ap, fmt);
 	ret = xvsnprintf(outbuf, length, fmt, ap);
 	va_end(ap);
-	return ret;
+	return ret > (int)length ? length : ret;
 }