aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Steven Schubiger <stsc@refcnt.org> 2014-04-04 23:36:24 +0200
committerGravatar Steven Schubiger <stsc@refcnt.org> 2014-04-04 23:36:24 +0200
commit71527c4451f7f95ba79b7f12da049620b1bbb9e9 (patch)
tree904640f1093f75625e4952083a88097301c79ced
parent70796385a6b2cf374bdf0d0c99bd2c09f9b711ed (diff)
downloadcolorize-71527c4451f7f95ba79b7f12da049620b1bbb9e9.tar.gz
colorize-71527c4451f7f95ba79b7f12da049620b1bbb9e9.tar.bz2
Localize variable with name of existing file
-rw-r--r--colorize.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/colorize.c b/colorize.c
index c12ce44..b7974b1 100644
--- a/colorize.c
+++ b/colorize.c
@@ -507,14 +507,15 @@ process_args (unsigned int arg_cnt, char **arg_strings, bool *bold, const struct
if (have_file)
{
+ const char *file_exists = color_string;
if (file_string)
- vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), color_string, "cannot be used as color string");
+ vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), file_exists, "cannot be used as color string");
else
{
if (VALID_FILE_TYPE (mode))
- vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), color_string, "must be preceeded by color string");
+ vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), file_exists, "must be preceeded by color string");
else
- vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), color_string, "is not a valid file type");
+ vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), file_exists, "is not a valid file type");
}
}
}