1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 17:05:06 +00:00

LibCore: Make CFile::open() assert that the filename is non-null

This commit is contained in:
Andreas Kling 2019-10-21 18:45:27 +02:00
parent 835496375f
commit 74bba649c3

View file

@ -26,6 +26,7 @@ bool CFile::open(int fd, CIODevice::OpenMode mode, ShouldCloseFileDescription sh
bool CFile::open(CIODevice::OpenMode mode) bool CFile::open(CIODevice::OpenMode mode)
{ {
ASSERT(!m_filename.is_null());
int flags = 0; int flags = 0;
if ((mode & CIODevice::ReadWrite) == CIODevice::ReadWrite) { if ((mode & CIODevice::ReadWrite) == CIODevice::ReadWrite) {
flags |= O_RDWR | O_CREAT; flags |= O_RDWR | O_CREAT;