X-Git-Url: http://git.shiar.net/unifont.git/blobdiff_plain/97511ef2ebd8e36eb5765eaa6f2f19ea97f88161..8e42f3d15c39e5c98149c9647c0cc1a318e9321a:/src/unihex2png diff --git a/src/unihex2png b/src/unihex2png index 3595f80..3708a59 100755 --- a/src/unihex2png +++ b/src/unihex2png @@ -38,7 +38,7 @@ $result = GetOptions ( ); if ($opt_help) { - print << "END"; + print << "END" or die ("Cannot print to stdout.\n"); Turn a GNU Unifont hex glyph page of 256 code points into a PNG file @@ -160,7 +160,7 @@ for ($count = 0; $count <= 15; $count++) { } if ($input) { - open (HEXFILE, "$input") or die ('Cannot open file\n'); + open (HEXFILE, "$input") or die ('Cannot open hex file for input.\n'); } else { *HEXFILE = *STDIN; } @@ -197,11 +197,11 @@ while () { } # Only close input file handler if it isn't STDIN. if ($input) { - close HEXFILE; + close HEXFILE or die ("Cannot properly close input file.\n"); } # Save image -open (PICTURE, ">$output") or die ("Cannot save image\n"); +open (PICTURE, ">$output") or die ("Cannot save image.\n"); binmode PICTURE; -print PICTURE $im->png; -close PICTURE; +print PICTURE $im->png or die ("Cannot write to picture file.\n"); +close PICTURE or die ("Cannot properly close output file.\n");