comparison src/doprnt.c @ 3705:fcf6ccb70eea

[xemacs-hg @ 2006-11-28 13:01:27 by aidan] Fix a crash when (format "%f" 1.2e+302) is evaluated.
author aidan
date Tue, 28 Nov 2006 13:01:29 +0000
parents 3d8143fc88e1
children 4ca1ef2bdb6a
comparison
equal deleted inserted replaced
3704:e2053838832f 3705:fcf6ccb70eea
774 xfree (text_to_print, Ibyte *); 774 xfree (text_to_print, Ibyte *);
775 } 775 }
776 #endif /* HAVE_BIGFLOAT */ 776 #endif /* HAVE_BIGFLOAT */
777 else 777 else
778 { 778 {
779 /* ASCII Decimal representation uses 2.4 times as many 779 Ibyte *text_to_print = alloca_array (char, 350);
780 bits as machine binary. */ 780 Ibyte constructed_spec[100];
781 char *text_to_print = 781 Ibyte *p = constructed_spec;
782 alloca_array (char, 32 +
783 max (spec->minwidth,
784 (int) max (sizeof (double),
785 sizeof (long)) * 3 +
786 max (spec->precision, 0)));
787 char constructed_spec[100];
788 char *p = constructed_spec;
789 782
790 /* Mostly reconstruct the spec and use sprintf() to 783 /* Mostly reconstruct the spec and use sprintf() to
791 format the string. */ 784 format the string. */
792 785
793 *p++ = '%'; 786 *p++ = '%';