Re: Remove line length restriction in passwordFromFile()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Fujii Masao <fujii(at)postgresql(dot)org>
Subject: Re: Remove line length restriction in passwordFromFile()
Date: 2020-09-01 15:14:47
Message-ID: 54742.1598973287@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> writes:
> The patch looks good to me, except the following minor thing.
> + if (fgets(buf.data + buf.len, buf.maxlen - buf.len - 1, fp) == NULL)
> IIUC fgets() reads the data with the specified size - 1, so ISTM that -1 of
> "buf.maxlen - buf.len - 1" is not necessary.

Good point, I was being unduly conservative. Thanks for reviewing
the patch!

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2020-09-01 15:22:18 Kerberos support broken on MSVC builds for Windows x64?
Previous Message Li Japin 2020-09-01 15:06:19 Re: Docs: inaccurate description about config settings