changeset 13:cd2e26a69461

don't allow passing a 0 to log10
author masneyb
date Fri, 30 Aug 2002 19:46:27 +0000
parents c1181ef9aaf0
children 83090328581e
files lib/misc.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/misc.c	Fri Aug 30 19:23:15 2002 +0000
+++ b/lib/misc.c	Fri Aug 30 19:46:27 2002 +0000
@@ -28,7 +28,7 @@
 
   if (dest_str != NULL)
     *dest_str = '\0';
-  len = log10 (number) + 1;
+  len = (number > 0 ? log10 (number) : 0) + 1;
 
   if (len <= 0) 
     {