Hi,
I noticed in patch
v58-0001-Add-support-for-apply-at-prepare-time-to-built-i.patch
> +static void
> +prepare_spoolfile_name(char *path, int szpath, Oid subid, char *gid)
> +{
> + PsfHashEntry *hentry;
> +
> + /*
> + * This name is used as the key in the psf_hash HTAB. Therefore, the
> name
> + * and the key must be exactly same lengths and padded with '\0' so
> + * garbage does not impact the HTAB lookups.
> + */
> + Assert(sizeof(hentry->name) == MAXPGPATH);
> + Assert(szpath == MAXPGPATH);
> + memset(path, '\0', MAXPGPATH);
> +
> + snprintf(path, MAXPGPATH, "%s/psf_%u_%s.changes", PSF_DIR, subid, gid);
> +}
The variable hentry is only used when --enable-cassert is specified, it will be
a warning if I don't specify the
--enable-cassert when execute configure
And the comment says the lengths are same, I think '
Assert(sizeof(hentry->name) == szpath) ' will be better.
Best regards.
Shenhao Wang