APPROVE COMMIT
NOTE: This patch has been committed.
See Sebastian’s original patch here:
http://www.sxemacs.org/list-archives/html/sxemacs-patches/2006-10/msg0000...
and the SXEmacs bug here:
http://issues.sxemacs.org/show_bug.cgi?id=18
for more details. Sebastian could use snprintf in his patch because SXEmacs
only builds on Unix; while I would prefer to do the same, snprintf is not
available in our Windows builds. Maybe we should integrate it when it’s not
available. Thank you for the fix, Sebastian!
src/ChangeLog addition:
2006-11-28 Aidan Kehoe <kehoea(a)parhasard.net>
* doprnt.c (emacs_doprnt_1):
Integrate Sebastian Freundt's SXEmacs bug fix for cases where a
format specifier overflows the allocated buffer with a float
format string.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/doprnt.c
===================================================================
RCS
Index: src/doprnt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/doprnt.c,v
retrieving revision 1.30
diff -u -r1.30 doprnt.c
--- src/doprnt.c 2005/01/24 23:33:50 1.30
+++ src/doprnt.c 2006/11/28 12:51:43
@@ -776,16 +776,9 @@
#endif /* HAVE_BIGFLOAT */
else
{
- /* ASCII Decimal representation uses 2.4 times as many
- bits as machine binary. */
- char *text_to_print =
- alloca_array (char, 32 +
- max (spec->minwidth,
- (int) max (sizeof (double),
- sizeof (long)) * 3 +
- max (spec->precision, 0)));
- char constructed_spec[100];
- char *p = constructed_spec;
+ Ibyte *text_to_print = alloca_array (char, 350);
+ Ibyte constructed_spec[100];
+ Ibyte *p = constructed_spec;
/* Mostly reconstruct the spec and use sprintf() to
format the string. */
--
Santa Maradona, priez pour moi!
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches