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 /string/argz-replace.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 'string/argz-replace.c')
| -rw-r--r-- | string/argz-replace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/string/argz-replace.c b/string/argz-replace.c index fdd9a8e1c9..d2add630ff 100644 --- a/string/argz-replace.c +++ b/string/argz-replace.c @@ -38,7 +38,7 @@ str_append (char **to, size_t *to_len, const char *buf, const size_t buf_len) else { free (*to); - *to = 0; + *to = NULL; } } @@ -53,10 +53,10 @@ __argz_replace (char **argz, size_t *argz_len, const char *str, const char *with if (str && *str) { - char *arg = 0; + char *arg = NULL; char *src = *argz; size_t src_len = *argz_len; - char *dst = 0; + char *dst = NULL; size_t dst_len = 0; int delayed_copy = 1; /* True while we've avoided copying anything. */ size_t str_len = strlen (str), with_len = strlen (with); @@ -84,7 +84,7 @@ __argz_replace (char **argz, size_t *argz_len, const char *str, const char *with else { str_append (&to, &to_len, from, strlen (from)); - from = 0; + from = NULL; } } } |
