From 4c5f2a9098b5be30f7e65eb6747968ddca9773f1 Mon Sep 17 00:00:00 2001 From: Ben Wiley Sittler Date: Fri, 7 Nov 2008 07:09:52 +0000 Subject: [PATCH] more accurate error message --- caca-php/examples/img2txt.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/caca-php/examples/img2txt.php b/caca-php/examples/img2txt.php index f2f0dca..49bfd9e 100755 --- a/caca-php/examples/img2txt.php +++ b/caca-php/examples/img2txt.php @@ -272,8 +272,8 @@ function main() $opt = $opt_and_arg[0]; $arg = $opt_and_arg[1]; if((substr($opt, 0, 2) == '--') - && - array_key_exists(substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : ''), $long_options)) + && + array_key_exists(substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : ''), $long_options)) { $opt = '-' . $long_options[substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : '')]; } @@ -374,7 +374,7 @@ function main() $export = caca_export_string($cv, $format?$format:"ansi"); if(!$export) { - fprintf(STDERR, "%s: Can't export to format '%s'\n", $argv[0], $format); + fprintf(STDERR, "%s: Can't export to format '%s'\n", $argv[0], $format?$format:"ansi"); return -1; } else