diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-09-23 21:35:09 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-09-23 21:35:09 +1000 |
commit | 4127f559ada4573e66c0e55dc920147d73e48974 (patch) | |
tree | 633668366d93093286bbff51a54a27c09ab31925 | |
parent | 5d596139d43743004524a23693851211d3327718 (diff) |
- (dtucker) [openbsd-compat/bsd-snprintf.c] Previous change was off by one,
which could have caused the justification to be wrong. ok djm@
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | openbsd-compat/bsd-snprintf.c | 4 |
2 files changed, 7 insertions, 3 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20040923 | ||
2 | - (dtucker) [openbsd-compat/bsd-snprintf.c] Previous change was off by one, | ||
3 | which could have caused the justification to be wrong. ok djm@ | ||
4 | |||
1 | 20040921 | 5 | 20040921 |
2 | - (dtucker) [openbsd-compat/bsd-snprintf.c] Check for max length too. | 6 | - (dtucker) [openbsd-compat/bsd-snprintf.c] Check for max length too. |
3 | ok djm@ | 7 | ok djm@ |
@@ -1750,4 +1754,4 @@ | |||
1750 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 1754 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
1751 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 1755 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
1752 | 1756 | ||
1753 | $Id: ChangeLog,v 1.3554 2004/09/21 11:35:55 dtucker Exp $ | 1757 | $Id: ChangeLog,v 1.3555 2004/09/23 11:35:09 dtucker Exp $ |
diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c index aea501c6f..b5a7ef7a0 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 | ||
61 | RCSID("$Id: bsd-snprintf.c,v 1.8 2004/09/21 11:32:13 dtucker Exp $"); | 61 | RCSID("$Id: bsd-snprintf.c,v 1.9 2004/09/23 11:35:09 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; strln <= max && 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; |