{
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);
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);