More explicit pointer truthiness check

`magic/database/DBio.c::DBOpenOnly` calls `dbReadOpen(CellDef *, bool, bool, int)` with a pointer for the second argument. While technically valid C, newer compilers (Clang 16) have recently frowned upon implicit pointer-to-int conversion, requiring the flag `-Wno-int-conversion` or else an error is raised.

Given that there is one such instance in the codebase, I think fixing it would be the simplest solution.
This commit is contained in:
Mohamed Gaber 2023-12-04 17:10:11 +02:00
parent 83ed73ac52
commit 9e6d1d789e
1 changed files with 1 additions and 1 deletions

View File

@ -1577,7 +1577,7 @@ DBOpenOnly(cellDef, name, setFileName, errptr)
*/
int *errptr; /* Pointer to int to hold error value */
{
dbReadOpen(cellDef, name, setFileName, FALSE, errptr);
dbReadOpen(cellDef, name != NULL, setFileName, FALSE, errptr);
}
/*