summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--openbsd-compat/bsd-snprintf.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 77b8fd160..982e229a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120040921
2 - (dtucker) [openbsd-compat/bsd-snprintf.c] Check for max length too.
3 ok djm@
4
120040912 520040912
2 - (djm) [loginrec.c] Start KNF and tidy up of this long-neglected file. 6 - (djm) [loginrec.c] Start KNF and tidy up of this long-neglected file.
3 No change in resultant binary 7 No change in resultant binary
@@ -1744,4 +1748,4 @@
1744 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 1748 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
1745 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 1749 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
1746 1750
1747$Id: ChangeLog,v 1.3552 2004/09/12 12:36:15 dtucker Exp $ 1751$Id: ChangeLog,v 1.3553 2004/09/21 11:32:12 dtucker Exp $
diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c
index e4d8a439a..aea501c6f 100644
--- a/openbsd-compat/bsd-snprintf.c
+++ b/openbsd-compat/bsd-snprintf.c
@@ -58,7 +58,7 @@
58 58
59#include "includes.h" 59#include "includes.h"
60 60
61RCSID("$Id: bsd-snprintf.c,v 1.7 2003/05/18 14:13:39 djm Exp $"); 61RCSID("$Id: bsd-snprintf.c,v 1.8 2004/09/21 11:32:13 dtucker Exp $");
62 62
63#if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */ 63#if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */
64# undef HAVE_SNPRINTF 64# undef HAVE_SNPRINTF
@@ -369,7 +369,7 @@ fmtstr(char *buffer, size_t *currlen, size_t maxlen,
369 if (value == 0) 369 if (value == 0)
370 value = "<NULL>"; 370 value = "<NULL>";
371 371
372 for (strln = 0; value[strln]; ++strln); /* strlen */ 372 for (strln = 0; strln <= max && value[strln]; ++strln); /* strlen */
373 padlen = min - strln; 373 padlen = min - strln;
374 if (padlen < 0) 374 if (padlen < 0)
375 padlen = 0; 375 padlen = 0;