Skip to content

Commit

Permalink
B100788 Enforcing the string parameter in prStrWidth
Browse files Browse the repository at this point in the history
Without this, Perl throws warnings to the effect of "Use of
uninitialized value $string in upack.." We really need a much
more robust system of error trapping and communication back
to the caller.

Thanks to Mark Tompsett for pointing me to the deb fix.
Thanks also to Patrick Matthäi for patching this upstream.
  • Loading branch information
cnighswonger committed Dec 9, 2014
1 parent 5ab5cce commit 67d6995
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Reuse.pm
Expand Up @@ -1260,6 +1260,9 @@ sub prStrWidth
my $FontSize = shift || $fontSize;
my $w = 0;

#FIXME: We need to have more robust error trapping and communication of that back to the caller
return unless $string; # there's no use continuing if no string is passed in

if(my($width) = ttfStrWidth($string, $Font, $FontSize))
{ return $width;
}
Expand Down

0 comments on commit 67d6995

Please sign in to comment.