aboutsummaryrefslogtreecommitdiffstats
path: root/colorize.c
diff options
context:
space:
mode:
authorGravatar Steven Schubiger <stsc@refcnt.org> 2017-08-04 21:31:12 +0200
committerGravatar Steven Schubiger <stsc@refcnt.org> 2017-08-04 21:31:12 +0200
commitae871d0d8e5fdd1a49f0bc4192cdc1e750dd0453 (patch)
tree45a28930b9f745f707aa2acb5139b81724d73687 /colorize.c
parentef3ba3bb9a06cffad7b4530a88f36b871abe2e0d (diff)
downloadcolorize-ae871d0d8e5fdd1a49f0bc4192cdc1e750dd0453.tar.gz
colorize-ae871d0d8e5fdd1a49f0bc4192cdc1e750dd0453.tar.bz2
Make assertions more explicit
Diffstat (limited to 'colorize.c')
-rw-r--r--colorize.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/colorize.c b/colorize.c
index 8c0afcb..a443368 100644
--- a/colorize.c
+++ b/colorize.c
@@ -649,7 +649,7 @@ process_args (unsigned int arg_cnt, char **arg_strings, char *attr, const struct
const char *color_string = arg_cnt >= 1 ? arg_strings[0] : NULL;
const char *file_string = arg_cnt == 2 ? arg_strings[1] : NULL;
- assert (color_string);
+ assert (color_string != NULL);
if (streq (color_string, "-"))
{
@@ -678,7 +678,7 @@ process_args (unsigned int arg_cnt, char **arg_strings, char *attr, const struct
gather_color_names (color_string, attr, color_names);
- assert (color_names[FOREGROUND]);
+ assert (color_names[FOREGROUND] != NULL);
if (color_names[BACKGROUND])
{
@@ -739,8 +739,8 @@ process_file_arg (const char *file_string, const char **file, FILE **stream)
*file = "stdin";
}
- assert (*stream);
- assert (*file);
+ assert (*stream != NULL);
+ assert (*file != NULL);
}
static void
@@ -814,7 +814,7 @@ gather_color_names (const char *color_string, char *attr, struct color_name **co
}
else
p = color + strlen (color);
- assert (p);
+ assert (p != NULL);
for (ch = color; *ch; ch++)
if (!isalpha (*ch))