Mercurial > hg > xemacs-beta
comparison src/doprnt.c @ 4287:89e64783d068
[xemacs-hg @ 2007-11-27 13:51:03 by aidan]
Merge a bugfix to some previously merged SXEmacs code; thank you Sebastian
Freundt for the code, and Hans de Graaff for the report.
author | aidan |
---|---|
date | Tue, 27 Nov 2007 13:51:10 +0000 |
parents | 4ca1ef2bdb6a |
children | d9eb5ea14f65 |
comparison
equal
deleted
inserted
replaced
4286:691b934b7b83 | 4287:89e64783d068 |
---|---|
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 Ascbyte *text_to_print = alloca_array (char, 350); | 779 Ascbyte *text_to_print; |
780 Ascbyte constructed_spec[100]; | 780 Ascbyte constructed_spec[100]; |
781 Ascbyte *p = constructed_spec; | 781 Ascbyte *p = constructed_spec; |
782 int alloca_sz = 350; | |
783 int min = spec->minwidth, prec = spec->precision; | |
784 | |
785 if (prec < 0) | |
786 prec = 0; | |
787 if (min < 0) | |
788 min = 0; | |
789 | |
790 if (32+min+prec > alloca_sz) | |
791 alloca_sz = 32 + min + prec; | |
792 | |
793 text_to_print = alloca_array(char, alloca_sz); | |
782 | 794 |
783 /* Mostly reconstruct the spec and use sprintf() to | 795 /* Mostly reconstruct the spec and use sprintf() to |
784 format the string. */ | 796 format the string. */ |
785 | 797 |
786 *p++ = '%'; | 798 *p++ = '%'; |