mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Fix comparisons of pointers with zero to compare with NULL instead.
Per C standard, these are semantically the same thing; but saying NULL when you mean NULL is good for readability. Marti Raudsepp, per results of INRIA's Coccinelle.
This commit is contained in:
@@ -846,7 +846,7 @@ lexescape(struct vars * v)
|
||||
if (ISERR())
|
||||
FAILW(REG_EESCAPE);
|
||||
/* ugly heuristic (first test is "exactly 1 digit?") */
|
||||
if (v->now - save == 0 || ((int) c > 0 && (int) c <= v->nsubexp))
|
||||
if (v->now == save || ((int) c > 0 && (int) c <= v->nsubexp))
|
||||
{
|
||||
NOTE(REG_UBACKREF);
|
||||
RETV(BACKREF, (chr) c);
|
||||
|
||||
@@ -395,7 +395,7 @@ getWeights(ArrayType *win)
|
||||
int i;
|
||||
float4 *arrdata;
|
||||
|
||||
if (win == 0)
|
||||
if (win == NULL)
|
||||
return weights;
|
||||
|
||||
if (ARR_NDIM(win) != 1)
|
||||
|
||||
@@ -616,7 +616,7 @@ find_in_dynamic_libpath(const char *basename)
|
||||
(errcode(ERRCODE_INVALID_NAME),
|
||||
errmsg("zero-length component in parameter \"dynamic_library_path\"")));
|
||||
|
||||
if (piece == 0)
|
||||
if (piece == NULL)
|
||||
len = strlen(p);
|
||||
else
|
||||
len = piece - p;
|
||||
|
||||
Reference in New Issue
Block a user