Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 79e15c7

Browse files
committed
Fix off-by-one in pg_xlogdump -r option.
Because of the bug, -r would not accept the rmgr with the highest ID.
1 parent 035a5e1 commit 79e15c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/pg_xlogdump/pg_xlogdump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ print_rmgr_list(void)
7575
{
7676
int i;
7777

78-
for (i = 0; i < RM_MAX_ID + 1; i++)
78+
for (i = 0; i <= RM_MAX_ID; i++)
7979
{
8080
printf("%s\n", RmgrDescTable[i].rm_name);
8181
}
@@ -492,7 +492,7 @@ main(int argc, char **argv)
492492
exit(EXIT_SUCCESS);
493493
}
494494

495-
for (i = 0; i < RM_MAX_ID; i++)
495+
for (i = 0; i <= RM_MAX_ID; i++)
496496
{
497497
if (pg_strcasecmp(optarg, RmgrDescTable[i].rm_name) == 0)
498498
{

0 commit comments

Comments
 (0)