Skip to content

Commit a994c3b

Browse files
committed
PG-1710 Do not hardcode length of WAL filename
There is a cosntant used by PostgreSQL itself.
1 parent c81cb87 commit a994c3b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

contrib/pg_tde/src/bin/pg_tde_archive_decrypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
static bool
1717
is_segment(const char *filename)
1818
{
19-
return strspn(filename, "0123456789ABCDEF") == 24 && filename[24] == '\0';
19+
return strspn(filename, "0123456789ABCDEF") == XLOG_FNAME_LEN && filename[XLOG_FNAME_LEN] == '\0';
2020
}
2121

2222
static void

contrib/pg_tde/src/bin/pg_tde_restore_encrypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
static bool
1717
is_segment(const char *filename)
1818
{
19-
return strspn(filename, "0123456789ABCDEF") == 24 && filename[24] == '\0';
19+
return strspn(filename, "0123456789ABCDEF") == XLOG_FNAME_LEN && filename[XLOG_FNAME_LEN] == '\0';
2020
}
2121

2222
static void

0 commit comments

Comments
 (0)