From: Heikki Linnakangas Date: Tue, 4 Jun 2013 15:51:43 +0000 (+0300) Subject: Fix off-by-one in pg_xlogdump -r option. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=79e15c7d86d3f781cc390a5a04db18254ce97b79;p=users%2Fbernd%2Fpostgres.git Fix off-by-one in pg_xlogdump -r option. Because of the bug, -r would not accept the rmgr with the highest ID. --- diff --git a/contrib/pg_xlogdump/pg_xlogdump.c b/contrib/pg_xlogdump/pg_xlogdump.c index 70dc8d15d5..24ca4fa855 100644 --- a/contrib/pg_xlogdump/pg_xlogdump.c +++ b/contrib/pg_xlogdump/pg_xlogdump.c @@ -75,7 +75,7 @@ print_rmgr_list(void) { int i; - for (i = 0; i < RM_MAX_ID + 1; i++) + for (i = 0; i <= RM_MAX_ID; i++) { printf("%s\n", RmgrDescTable[i].rm_name); } @@ -492,7 +492,7 @@ main(int argc, char **argv) exit(EXIT_SUCCESS); } - for (i = 0; i < RM_MAX_ID; i++) + for (i = 0; i <= RM_MAX_ID; i++) { if (pg_strcasecmp(optarg, RmgrDescTable[i].rm_name) == 0) {