Fix off-by-one in passing buffer size to xsnprintf

This would cause a consistent panic (exit() call) without reason.
This should not enable any overruns (but check my work).

Signed-off-by: Dan Farina <drfarina@acm.org>
This commit is contained in:
Dan Farina
2010-12-23 00:46:59 -08:00
parent f969dca821
commit 0bae682a0d

View File

@@ -883,7 +883,7 @@ do_standby_clone(void)
size_t buf_sz = strlen(first_wal_seg_pq);
first_wal_segment = malloc(buf_sz + 1);
xsnprintf(first_wal_segment, buf_sz, "%s", first_wal_seg_pq);
xsnprintf(first_wal_segment, buf_sz + 1, "%s", first_wal_seg_pq);
}
first_wal_segment = PQgetvalue(res, 0, 0);