summaryrefslogtreecommitdiffstats
path: root/lib/libc/db
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-10 19:33:58 +0000
committerpfg <pfg@FreeBSD.org>2016-04-10 19:33:58 +0000
commit6e91d78151e10ed31c475cafe6a1e1f11950c1d9 (patch)
tree6796a0cd32cea8fd5591b7f2c6d10ae7f153ccb9 /lib/libc/db
parent1485828b0840fbefcb7789ae54df9650c16fda61 (diff)
downloadFreeBSD-src-6e91d78151e10ed31c475cafe6a1e1f11950c1d9.zip
FreeBSD-src-6e91d78151e10ed31c475cafe6a1e1f11950c1d9.tar.gz
libc: replace 0 with NULL for pointers.
While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine)
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/hash/hash.c2
-rw-r--r--lib/libc/db/hash/hash_buf.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index fc4e50e..f7b1427 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -771,7 +771,7 @@ next_bucket:
if (__big_keydata(hashp, bufp, key, data, 1))
return (ERROR);
} else {
- if (hashp->cpage == 0)
+ if (hashp->cpage == NULL)
return (ERROR);
key->data = (u_char *)hashp->cpage->page + bp[ndx];
key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx];
diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c
index e79e7b3..5c62a2c 100644
--- a/lib/libc/db/hash/hash_buf.c
+++ b/lib/libc/db/hash/hash_buf.c
@@ -245,7 +245,7 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp)
*/
for (xbp = bp; xbp->ovfl;) {
next_xbp = xbp->ovfl;
- xbp->ovfl = 0;
+ xbp->ovfl = NULL;
xbp = next_xbp;
/* Check that ovfl pointer is up date. */
@@ -350,7 +350,7 @@ __buf_free(HTAB *hashp, int do_free, int to_disk)
void
__reclaim_buf(HTAB *hashp, BUFHEAD *bp)
{
- bp->ovfl = 0;
+ bp->ovfl = NULL;
bp->addr = 0;
bp->flags = 0;
BUF_REMOVE(bp);
OpenPOWER on IntegriCloud