diff options
| author | Alejandro Colomar <alx@kernel.org> | 2024-11-16 16:51:31 +0100 |
|---|---|---|
| committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-11-25 16:45:59 -0300 |
| commit | 53fcdf5f743aa9b02972eec658e66f96d6a63386 (patch) | |
| tree | e1bd3ed90d89027abe4b8ba6f0dbffd833f08a9b /inet | |
| parent | 83d4b42ded712bbbc22ceeefe886b8315190da5b (diff) | |
| download | glibc-53fcdf5f743aa9b02972eec658e66f96d6a63386.tar.xz glibc-53fcdf5f743aa9b02972eec658e66f96d6a63386.zip | |
Silence most -Wzero-as-null-pointer-constant diagnostics
Replace 0 by NULL and {0} by {}.
Omit a few cases that aren't so trivial to fix.
Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
Link: <https://software.codidact.com/posts/292718/292759#answer-292759>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'inet')
| -rw-r--r-- | inet/rcmd.c | 12 | ||||
| -rw-r--r-- | inet/rexec.c | 2 | ||||
| -rw-r--r-- | inet/ruserpass.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/inet/rcmd.c b/inet/rcmd.c index dcf4f4ffd1..0abbdc89fe 100644 --- a/inet/rcmd.c +++ b/inet/rcmd.c @@ -179,7 +179,7 @@ rcmd: socket: All ports in use\n")); else __fxprintf(NULL, "rcmd: socket: %m\n"); - __sigprocmask (SIG_SETMASK, &omask, 0); + __sigprocmask (SIG_SETMASK, &omask, NULL); freeaddrinfo(res); return -1; } @@ -209,7 +209,7 @@ rcmd: socket: All ports in use\n")); free (buf); } __set_errno (oerrno); - perror(0); + perror(NULL); ai = ai->ai_next; getnameinfo(ai->ai_addr, ai->ai_addrlen, paddr, sizeof(paddr), @@ -232,11 +232,11 @@ rcmd: socket: All ports in use\n")); freeaddrinfo(res); (void)__fxprintf(NULL, "%s: %s\n", *ahost, __strerror_r(errno, errbuf, sizeof (errbuf))); - __sigprocmask (SIG_SETMASK, &omask, 0); + __sigprocmask (SIG_SETMASK, &omask, NULL); return -1; } lport--; - if (fd2p == 0) { + if (fd2p == NULL) { __write(s, "", 1); lport = 0; } else { @@ -344,7 +344,7 @@ socket: protocol failure in circuit setup\n")) >= 0) } goto bad2; } - __sigprocmask (SIG_SETMASK, &omask, 0); + __sigprocmask (SIG_SETMASK, &omask, NULL); freeaddrinfo(res); return s; bad2: @@ -352,7 +352,7 @@ bad2: (void)__close(*fd2p); bad: (void)__close(s); - __sigprocmask (SIG_SETMASK, &omask, 0); + __sigprocmask (SIG_SETMASK, &omask, NULL); freeaddrinfo(res); return -1; } diff --git a/inet/rexec.c b/inet/rexec.c index d479753fc2..8e8653f30f 100644 --- a/inet/rexec.c +++ b/inet/rexec.c @@ -103,7 +103,7 @@ retry: perror(res0->ai_canonname); goto bad; } - if (fd2p == 0) { + if (fd2p == NULL) { (void) __write(s, "", 1); port = 0; } else { diff --git a/inet/ruserpass.c b/inet/ruserpass.c index 75e2a06552..903fc966fd 100644 --- a/inet/ruserpass.c +++ b/inet/ruserpass.c @@ -157,7 +157,7 @@ next: case LOGIN: if (token()) { - if (*aname == 0) { + if (*aname == NULL) { char *newp; newp = malloc((unsigned) strlen(tokval) + 1); if (newp == NULL) @@ -180,7 +180,7 @@ next: warnx(_("Remove 'password' line or make file unreadable by others.")); goto bad; } - if (token() && *apass == 0) { + if (token() && *apass == NULL) { char *newp; newp = malloc((unsigned) strlen(tokval) + 1); if (newp == NULL) |
