Skip to content

Commit

Permalink
Give a warning for every bad character in the message
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Sep 8, 2023
1 parent a6cd2b4 commit 8121da0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/banner
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ else {
}

# check message
my $char_error;
while ($message =~ /(.)/g) {
unless ($ascii_to_table{$1}) {
warn "$Program: The character `$1' is not in my character set\n";
exit EX_FAILURE;
$char_error++;
}
}

exit EX_FAILURE if $char_error;

# print banner
while ($message =~ /(.)/g) {
my @line = (' ') x DWIDTH;
Expand Down

0 comments on commit 8121da0

Please sign in to comment.