aboutsummaryrefslogtreecommitdiff
path: root/src/timezone/zic.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-10-29 15:51:52 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2010-10-29 15:51:52 -0400
commitbfd3f37be309c3647844aed937e6a66aad5fd3cb (patch)
tree5bc39a02df05c848eb88e300a25ef83af4cd43b6 /src/timezone/zic.c
parent48a1fb23900d73e7d9cb2dc0408c745cd03597a7 (diff)
downloadpostgresql-bfd3f37be309c3647844aed937e6a66aad5fd3cb.tar.gz
postgresql-bfd3f37be309c3647844aed937e6a66aad5fd3cb.zip
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.
Diffstat (limited to 'src/timezone/zic.c')
-rw-r--r--src/timezone/zic.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 00ca6faab41..8a95d6ac3f7 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -810,7 +810,7 @@ associate(void)
* Note, though, that if there's no rule, a '%s' in the format is
* a bad thing.
*/
- if (strchr(zp->z_format, '%') != 0)
+ if (strchr(zp->z_format, '%') != NULL)
error(_("%s in ruleless zone"));
}
}
@@ -1111,9 +1111,9 @@ inzsub(char **fields, int nfields, int iscont)
z.z_filename = filename;
z.z_linenum = linenum;
z.z_gmtoff = gethms(fields[i_gmtoff], _("invalid UTC offset"), TRUE);
- if ((cp = strchr(fields[i_format], '%')) != 0)
+ if ((cp = strchr(fields[i_format], '%')) != NULL)
{
- if (*++cp != 's' || strchr(cp, '%') != 0)
+ if (*++cp != 's' || strchr(cp, '%') != NULL)
{
error(_("invalid abbreviation format"));
return FALSE;
@@ -1438,9 +1438,9 @@ rulesub(struct rule * rp, const char *loyearp, const char *hiyearp,
}
else
{
- if ((ep = strchr(dp, '<')) != 0)
+ if ((ep = strchr(dp, '<')) != NULL)
rp->r_dycode = DC_DOWLEQ;
- else if ((ep = strchr(dp, '>')) != 0)
+ else if ((ep = strchr(dp, '>')) != NULL)
rp->r_dycode = DC_DOWGEQ;
else
{
@@ -2826,7 +2826,7 @@ mkdirs(char *argname)
if (argname == NULL || *argname == '\0')
return 0;
cp = name = ecpyalloc(argname);
- while ((cp = strchr(cp + 1, '/')) != 0)
+ while ((cp = strchr(cp + 1, '/')) != NULL)
{
*cp = '\0';
#ifdef WIN32