Feature #2437 » 0004-Use-NULL-instead-of-0-where-pointers-are-expected.patch
src/lemon.c | ||
---|---|---|
/* Allocate a new parser action */
|
||
struct action *Action_new(){
|
||
static struct action *freelist = 0;
|
||
static struct action *freelist = NULL;
|
||
struct action *new;
|
||
if( freelist==0 ){
|
||
if( freelist==NULL ){
|
||
int i;
|
||
int amt = 100;
|
||
freelist = (struct action *)malloc( sizeof(struct action)*amt );
|
src/lempar.c | ||
---|---|---|
#ifndef NDEBUG
|
||
#include <stdio.h>
|
||
static FILE *yyTraceFILE = 0;
|
||
static char *yyTracePrompt = 0;
|
||
static FILE *yyTraceFILE = NULL;
|
||
static char *yyTracePrompt = NULL;
|
||
#endif /* NDEBUG */
|
||
#ifndef NDEBUG
|
||
... | ... | |
void (*freeProc)(void*) /* Function used to reclaim memory */
|
||
){
|
||
yyParser *pParser = (yyParser*)p;
|
||
if( pParser==0 ) return;
|
||
if( pParser==NULL ) return;
|
||
while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
|
||
(*freeProc)((void*)pParser);
|
||
}
|
src/mod_cgi.c | ||
---|---|---|
c->file.mmap.length = c->file.length;
|
||
if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.mmap.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
|
||
if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, c->file.mmap.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
|
||
log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
|
||
strerror(errno), c->file.name, c->file.fd);
|
||
src/mod_compress.c | ||
---|---|---|
if (sce->st.st_size < 128) return HANDLER_GO_ON;
|
||
/* check if mimetype is in compress-config */
|
||
content_type = 0;
|
||
content_type = NULL;
|
||
if (sce->content_type->ptr) {
|
||
char *c;
|
||
if ( (c = strchr(sce->content_type->ptr, ';')) != 0) {
|
||
if ( (c = strchr(sce->content_type->ptr, ';')) != NULL) {
|
||
content_type = srv->tmp_buf;
|
||
buffer_copy_string_len(content_type, sce->content_type->ptr, c - sce->content_type->ptr);
|
||
}
|
src/mod_extforward.c | ||
---|---|---|
"could not resolve hostname ", host, " because ", gai_strerror(result), strerror(errno));
|
||
return NULL;
|
||
} else if (res0 == 0) {
|
||
} else if (res0 == NULL) {
|
||
log_error_write(srv, __FILE__, __LINE__, "SSS",
|
||
"Problem in resolving hostname ", host, ": succeeded, but no information returned");
|
||
}
|
src/mod_proxy.c | ||
---|---|---|
if (s_len > ct_len + 1) {
|
||
char *pi_offset;
|
||
if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
|
||
if (NULL != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
|
||
path_info_offset = pi_offset - fn->ptr;
|
||
}
|
||
}
|
src/mod_webdav.c | ||
---|---|---|
return HANDLER_ERROR;
|
||
}
|
||
if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
|
||
if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
|
||
log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
|
||
strerror(errno), c->file.name, c->file.fd);
|
||
close(c->file.fd);
|
src/network_writev.c | ||
---|---|---|
#endif
|
||
}
|
||
if (MAP_FAILED == (c->file.mmap.start = mmap(0, to_mmap, PROT_READ, MAP_SHARED, c->file.fd, c->file.mmap.offset))) {
|
||
if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, to_mmap, PROT_READ, MAP_SHARED, c->file.fd, c->file.mmap.offset))) {
|
||
/* close it here, otherwise we'd have to set FD_CLOEXEC */
|
||
log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed:",
|
src/request.c | ||
---|---|---|
i++;
|
||
first = i+1;
|
||
is_key = 1;
|
||
value = 0;
|
||
value = NULL;
|
||
#if 0
|
||
/**
|
||
* for Bug 1230 keep the key_len a live
|
src/stream.c | ||
---|---|---|
return -1;
|
||
}
|
||
f->start = mmap(0, f->size, PROT_READ, MAP_SHARED, fd, 0);
|
||
f->start = mmap(NULL, f->size, PROT_READ, MAP_SHARED, fd, 0);
|
||
close(fd);
|
||