Use NULL instead of 0 for pointers.
The malloc will return a pointer to the allocated memory if successful, otherwise a NULL pointer is returned.
This commit is contained in:
parent
4f6dd82a2f
commit
d11537c785
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297964
@ -82,7 +82,7 @@ read_buf(FILE *fp, off_t off, size_t len)
|
||||
}
|
||||
|
||||
buf = malloc(len);
|
||||
if (buf == 0) {
|
||||
if (buf == NULL) {
|
||||
warn("cannot malloc %zd bytes of memory", len);
|
||||
return (NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user