There were a few random places where 0 was being used as a null pointer
constant.
We have a NULL macro for this very purpose, use it.
There is also some interest in actually deprecating the use of 0 as a
null pointer constant in C.
This was found with -Wzero-as-null-pointer-constant which was enabled
for C in GCC 15 (not enabled with Wall or Wextra... yet).
Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
*lock = 0;
- pthread_exit(0);
+ pthread_exit(NULL);
}
return NULL;
}
- pkey = ENGINE_load_private_key(engine, (char *) last, 0, 0);
+ pkey = ENGINE_load_private_key(engine, (char *) last, NULL, NULL);
if (pkey == NULL) {
*err = "ENGINE_load_private_key() failed";
qc = ngx_quic_get_connection(c);
qc->error = (ngx_uint_t) -1;
- qc->error_reason = 0;
+ qc->error_reason = NULL;
c->log->action = "decrypting packet";
{
int rc;
- ctx->zstream.next_in = Z_NULL;
+ ctx->zstream.next_in = NULL;
ctx->zstream.avail_in = 0;
ctx->zstream.zalloc = ngx_http_gunzip_filter_alloc;
}
for (prm = cmd->params; prm->name.len; prm++) {
- if (prm->mandatory && params[prm->index] == 0) {
+ if (prm->mandatory && params[prm->index] == NULL) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"mandatory \"%V\" parameter is absent "
"in \"%V\" SSI command",
struct tm *t;
char buf[4];
- s = time(0);
+ s = time(NULL);
t = localtime(&s);