Re: [PATCH v2 02/21] clone: use xfopen() instead of fopen()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 3, 2017, 15:02 UTC
- Message-ID
- <alpine.DEB.2.20.1705031701120.3480@virtualbox>
- In-Reply-To
- <20170503101706.9223-3-pclouds@gmail.com>
Hi Duy,
On Wed, 3 May 2017, Nguyễn Thái Ngọc Duy wrote:
Show 5 quoted lines
> This code uses the result FILE pointer right away without the NULL > check. Let's use xfopen() and die if we could not open the file. That's > still better than crashing, > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
While funny to read, maybe it would be better to spell it out clearly:
copy_alternates() called fopen() without handling errors. By switching to xfopen(), this bug is fixed.
Ciao, Dscho