mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Use NULL instead of 0 for pointers.
The strchr(3) returns a NULL if the character does not appears in the string. The malloc will return NULL if cannot allocate memory.
This commit is contained in:
parent
fa02fc2d8f
commit
45be165f23
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297962
|
@ -170,7 +170,7 @@ doread(int fd, FILE *of, const char *_devname)
|
|||
secsize = 128 << fdt.secsize;
|
||||
tracksize = fdt.sectrac * secsize;
|
||||
mediasize = tracksize * fdt.tracks * fdt.heads;
|
||||
if ((trackbuf = malloc(tracksize)) == 0)
|
||||
if ((trackbuf = malloc(tracksize)) == NULL)
|
||||
errx(EX_TEMPFAIL, "out of memory");
|
||||
|
||||
if (!quiet)
|
||||
|
|
|
@ -200,10 +200,10 @@ parse_fmt(const char *s, enum fd_drivetype type,
|
|||
*out = in;
|
||||
|
||||
for (i = 0;; i++) {
|
||||
if (s == 0)
|
||||
if (s == NULL)
|
||||
break;
|
||||
|
||||
if ((cp = strchr(s, ',')) == 0) {
|
||||
if ((cp = strchr(s, ',')) == NULL) {
|
||||
s1 = strdup(s);
|
||||
if (s1 == NULL)
|
||||
abort();
|
||||
|
|
Loading…
Reference in a new issue