]> granicus.if.org Git - flex/commitdiff
Improvement request 1069716 log vs. log10
authorJohn Millaway <john43@users.sourceforge.net>
Thu, 22 Dec 2005 00:24:19 +0000 (00:24 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Thu, 22 Dec 2005 00:24:19 +0000 (00:24 +0000)
buf.c
main.c

diff --git a/buf.c b/buf.c
index 647be6903cb28920bdb17334cd080beddd0b8b76..fb3bbd1e0e342998767e4dc3476b8f03916f7749 100644 (file)
--- a/buf.c
+++ b/buf.c
@@ -89,7 +89,7 @@ struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
 {
     char   *t, *fmt = "#line %d \"%s\"\n";
     
-    t = flex_alloc (strlen (fmt) + strlen (filename) + (int)(1 + log(lineno>=0?lineno:-lineno)/log(10)) + 1);
+    t = flex_alloc (strlen (fmt) + strlen (filename) + (int)(1 + log10(lineno>=0?lineno:-lineno)) + 1);
     sprintf (t, fmt, lineno, filename);
     buf = buf_strappend (buf, t);
     flex_free (t);
diff --git a/main.c b/main.c
index f5f1812d526911d31b81bd68be7a3368cd3c4ff0..c8ea63829b9aac3e193593e55b43f8822f048560 100644 (file)
--- a/main.c
+++ b/main.c
@@ -436,7 +436,7 @@ void check_options ()
         for (i = 1; i <= lastsc; i++) {
              char *str, *fmt = "#define %s %d\n";
 
-             str = (char*)flex_alloc(strlen(fmt) + strlen(scname[i]) + (int)(1 + log(i)/log(10)) + 2);
+             str = (char*)flex_alloc(strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2);
              sprintf(str, fmt,      scname[i], i - 1);
              buf_strappend(&tmpbuf, str);
              free(str);