diff options
-rwxr-xr-x | soxdial | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -770,10 +770,15 @@ for ($argc = 0; $argc < @ARGV; $argc++) { warn "$SELF: bluebox mode disabled (touchtone enabled).\n" if $verbose; } else { $_ = lc $_; + + # paranoia: in case we get non-printable characters, we don't want + # to print them in verbose mode (yes, I use /dev/urandom for testing). + ($printable = $_) =~ s,[^\x20-\x7e],.,g; + if($verbose && (/^--?[a-z]/i)) { - warn "$SELF: treating '$_' as a dial string (might be a typo?)\n"; + warn "$SELF: treating '$printable' as a dial string (might be a typo?)\n"; } - warn "$SELF: start dial string '$_'\n" if $verbose; + warn "$SELF: start dial string '$printable'\n" if $verbose; my $time_override; if($bluebox) { @@ -802,7 +807,7 @@ for ($argc = 0; $argc < @ARGV; $argc++) { warn "$SELF: no valid digits in dial string.\n" if $verbose; } - warn "$SELF: end dial string '$_'\n" if $verbose; + warn "$SELF: end dial string '$printable'\n" if $verbose; } } |