1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

In _line_append, use "sizeof buf - 1" rather than equivalent "4095"

* lib/config/config.c:
This commit is contained in:
Jim Meyering 2007-07-20 15:26:39 +00:00
parent c93e6b5f79
commit e732de541e
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
Version 2.02.28 -
In _line_append, use "sizeof buf - 1" rather than equivalent "4095"
Introduce is_same_inode macro, now including a comparison of st_dev.
Don't leak a file descriptor in _lock_file(), when flock fails.
Add SUN's LDOM virtual block device to filters

View File

@ -367,8 +367,8 @@ static int _line_append(struct output_line *outline, const char *fmt, ...)
int n;
va_start(ap, fmt);
n = vsnprintf(&buf[0], 4095, fmt, ap);
if (n < 0 || n > 4095) {
n = vsnprintf(&buf[0], sizeof buf - 1, fmt, ap);
if (n < 0 || n > sizeof buf - 1) {
log_error("vsnprintf failed for config line");
return 0;
}