Fix edge case when file is empty

This commit is contained in:
twinaphex 2017-11-24 21:39:10 +01:00
parent 5ce0aca435
commit 92ea40d96e

View File

@ -75,7 +75,7 @@ struct nbio_t* nbio_open(const char * filename, unsigned mode)
if (len)
buf = malloc(len);
if (!buf)
if (len && !buf)
goto error;
handle->data = buf;