summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2020-02-25 08:58:32 +0000
committerChris Liddell <chris.liddell@artifex.com>2020-02-26 08:18:49 +0000
commit32f3d6703a7e5c6582c066837783c6697e98b1ca (patch)
tree5bfbe4ac1016391ae20ae430338bc60b8492a574
parent6c1002cc251907e702fd5db9dc81365a964816c6 (diff)
downloadghostpdl-32f3d6703a7e5c6582c066837783c6697e98b1ca.tar.gz
Replace 0 with NULL for pointer validation/setting.
Also make validation an explicit comparison with NULL i.e.: "if (mem != NULL)" rather than "if (mem)".
-rw-r--r--base/gsline.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/base/gsline.c b/base/gsline.c
index 89cd40d65..a47551116 100644
--- a/base/gsline.c
+++ b/base/gsline.c
@@ -177,7 +177,7 @@ gx_set_dash(gx_dash_params * dash, const float *pattern, uint length,
dist_left = 0.0;
if (mem && ppat) {
gs_free_object(mem, ppat, "gx_set_dash(old pattern)");
- ppat = 0;
+ ppat = NULL;
}
} else {
uint size = length * sizeof(float);
@@ -205,14 +205,14 @@ gx_set_dash(gx_dash_params * dash, const float *pattern, uint length,
(dist_left > 0 || pattern[index] != 0)
)
ink = !ink, index++;
- if (mem) {
- if (ppat == 0)
+ if (mem != NULL) {
+ if (ppat == NULL)
ppat = (float *)gs_alloc_bytes(mem, size,
"gx_set_dash(pattern)");
else if (length != dash->pattern_size)
ppat = gs_resize_object(mem, ppat, size,
"gx_set_dash(pattern)");
- if (ppat == 0)
+ if (ppat == NULL)
return_error(gs_error_VMerror);
}
if (ppat != pattern)