summaryrefslogtreecommitdiff
path: root/libexec/telnetd/global.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/telnetd/global.c')
-rw-r--r--libexec/telnetd/global.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libexec/telnetd/global.c b/libexec/telnetd/global.c
index 841fbb5ae80..395102757f8 100644
--- a/libexec/telnetd/global.c
+++ b/libexec/telnetd/global.c
@@ -93,6 +93,8 @@ output_data (const char *format, ...)
va_start(args, format);
remaining = BUFSIZ - (nfrontp - netobuf);
+ if (remaining == 0)
+ return remaining;
if ((n = vsnprintf(nfrontp, remaining, format, args)) >= remaining || n < 0)
n = strlen(nfrontp);
nfrontp += n;