182p8 - width() and height() do not return 0 when set to invalid input.
authorRick Bird <nveid@bender.theari.com>
Sun, 27 Mar 2011 05:24:06 +0000 (01:24 -0400)
committerRick Bird <nveid@bender.theari.com>
Sun, 27 Mar 2011 05:24:06 +0000 (01:24 -0400)
src/bsd.c

index b75be8b8154ff6a3998ffb2c8f51e5857e68f0d3..5ce7127c72e616226126d32afee89ce996a3bc64 100644 (file)
--- a/src/bsd.c
+++ b/src/bsd.c
@@ -4589,7 +4589,7 @@ FUNCTION(fun_width)
   DESC *match;
   if (!*args[0])
     safe_str(T("#-1 FUNCTION REQUIRES ONE ARGUMENT"), buff, bp);
-  else if ((match = lookup_desc(executor, args[0])))
+  else if ((match = lookup_desc(executor, args[0])) && match->width > 0)
     safe_integer(match->width, buff, bp);
   else if (args[1])
     safe_str(args[1], buff, bp);
@@ -4602,7 +4602,7 @@ FUNCTION(fun_height)
   DESC *match;
   if (!*args[0])
     safe_str(T("#-1 FUNCTION REQUIRES ONE ARGUMENT"), buff, bp);
-  else if ((match = lookup_desc(executor, args[0])))
+  else if ((match = lookup_desc(executor, args[0])) && match->height > 0)
     safe_integer(match->height, buff, bp);
   else if (args[1])
     safe_str(args[1], buff, bp);