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 /resolv/res_hconf.c | |
| 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 'resolv/res_hconf.c')
| -rw-r--r-- | resolv/res_hconf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c index e1158943a9..1737bce2f9 100644 --- a/resolv/res_hconf.c +++ b/resolv/res_hconf.c @@ -118,12 +118,12 @@ arg_trimdomain_list (const char *fname, int line_num, const char *args) if (__asprintf (&buf, _("\ %s: line %d: cannot specify more than %d trim domains"), fname, line_num, TRIMDOMAINS_MAX) < 0) - return 0; + return NULL; __fxprintf (NULL, "%s", buf); free (buf); - return 0; + return NULL; } _res_hconf.trimdomain[_res_hconf.num_trimdomains++] = __strndup (start, len); @@ -139,12 +139,12 @@ arg_trimdomain_list (const char *fname, int line_num, const char *args) if (__asprintf (&buf, _("\ %s: line %d: list delimiter not followed by domain"), fname, line_num) < 0) - return 0; + return NULL; __fxprintf (NULL, "%s", buf); free (buf); - return 0; + return NULL; } default: break; @@ -175,12 +175,12 @@ arg_bool (const char *fname, int line_num, const char *args, unsigned flag) if (__asprintf (&buf, _("%s: line %d: expected `on' or `off', found `%s'\n"), fname, line_num, args) < 0) - return 0; + return NULL; __fxprintf (NULL, "%s", buf); free (buf); - return 0; + return NULL; } return args; } @@ -190,7 +190,7 @@ static void parse_line (const char *fname, int line_num, const char *str) { const char *start; - const struct cmd *c = 0; + const struct cmd *c = NULL; size_t len; size_t i; |
