summaryrefslogtreecommitdiffstats
path: root/lib/libc/resolv
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/resolv')
-rw-r--r--lib/libc/resolv/mtctxres.c11
-rw-r--r--lib/libc/resolv/res_init.c4
-rw-r--r--lib/libc/resolv/res_mkupdate.c4
3 files changed, 8 insertions, 11 deletions
diff --git a/lib/libc/resolv/mtctxres.c b/lib/libc/resolv/mtctxres.c
index f02a7f5..c2aea38 100644
--- a/lib/libc/resolv/mtctxres.c
+++ b/lib/libc/resolv/mtctxres.c
@@ -75,7 +75,7 @@ __res_init_ctx(void) {
return (0);
}
- if ((mt = malloc(sizeof (mtctxres_t))) == 0) {
+ if ((mt = malloc(sizeof(mtctxres_t))) == NULL) {
errno = ENOMEM;
return (-1);
}
@@ -94,10 +94,7 @@ __res_init_ctx(void) {
static void
__res_destroy_ctx(void *value) {
- mtctxres_t *mt = (mtctxres_t *)value;
-
- if (mt != 0)
- free(mt);
+ free(value);
}
#endif
@@ -130,9 +127,9 @@ ___mtctxres(void) {
* that fails return a global context.
*/
if (mt_key_initialized) {
- if (((mt = pthread_getspecific(key)) != 0) ||
+ if (((mt = pthread_getspecific(key)) != NULL) ||
(__res_init_ctx() == 0 &&
- (mt = pthread_getspecific(key)) != 0)) {
+ (mt = pthread_getspecific(key)) != NULL)) {
return (mt);
}
}
diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c
index 715b654..76ad311 100644
--- a/lib/libc/resolv/res_init.c
+++ b/lib/libc/resolv/res_init.c
@@ -315,7 +315,7 @@ __res_vinit(res_state statp, int preinit) {
while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
cp++;
*cp = '\0';
- *pp++ = 0;
+ *pp++ = NULL;
}
#define MATCH(line, name) \
@@ -391,7 +391,7 @@ __res_vinit(res_state statp, int preinit) {
while (*cp != '\0' && *cp != ' ' && *cp != '\t')
cp++;
*cp = '\0';
- *pp++ = 0;
+ *pp++ = NULL;
havesearch = 1;
continue;
}
diff --git a/lib/libc/resolv/res_mkupdate.c b/lib/libc/resolv/res_mkupdate.c
index 5c5858d..45667c4 100644
--- a/lib/libc/resolv/res_mkupdate.c
+++ b/lib/libc/resolv/res_mkupdate.c
@@ -1175,7 +1175,7 @@ res_protocolname(int num) {
if (protolist == (struct valuelist *)0)
res_buildprotolist();
pp = cgetprotobynumber(num);
- if (pp == 0) {
+ if (pp == NULL) {
(void) sprintf(number, "%d", num);
return (number);
}
@@ -1190,7 +1190,7 @@ res_servicename(u_int16_t port, const char *proto) { /*%< Host byte order. */
if (servicelist == (struct valuelist *)0)
res_buildservicelist();
ss = cgetservbyport(htons(port), proto);
- if (ss == 0) {
+ if (ss == NULL) {
(void) sprintf(number, "%d", port);
return (number);
}
OpenPOWER on IntegriCloud