[Tilesathome] Illegal division by zero

Dirk-Lüder Kreie osm-list at deelkar.net
Wed Jun 11 19:14:09 BST 2008


Jiri Klement schrieb:
> I've run into the same error today. Following patch makes it work for me:
> 
> Index: lines2curves.pl
> ===================================================================
> --- lines2curves.pl     (revision 8167)
> +++ lines2curves.pl     (working copy)
> @@ -147,8 +147,7 @@
>      shift @$points_ref;
> 
>      foreach my $point_ref (@$points_ref) {
> -        if ($point_ref->[0].$point_ref->[1] eq
> -                $clean_points_ref->[-1][0].$clean_points_ref->[-1][1]) {
> +        if (($point_ref->[0] == $clean_points_ref->[-1][0]) &&
> ($point_ref->[1] == $clean_points_ref->[-1][1])) {
>                  next;
>          }
> 
> I don't understand why numeric values were compared using eq operator.
> There are other places in lines2curves.pl comparing points this way.

I don't understand either why this was converted into a string 
comparison, but if this really fixes the issue (i.e. by making a 
comparison work that wouldn't work when used as string comparison) I'm 
all for it.

Will apply to svn.

-- 

Dirk-Lüder "Deelkar" Kreie
Bremen - 53.0952°N 8.8652°E

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20080611/2e4f55ca/attachment.pgp>


More information about the Tilesathome mailing list