Problem with d2b called from sprintf

Jim & Lori Lawrence jimlori@provide.net
Tue Oct 6 04:14:00 GMT 1998


 
I'm using Newlib 1.8.1.
I'm having a problem with some data in low 
memory being overwritten when calling sprintf.  The calling sequence is as 
follows:
 
1. Sprintf calls d2b in mprec.c 
2. d2b calls balloc also in mprec.c
3. balloc calls calloc 
4. calloc fails, returns a null pointer to balloc
5. balloc returns a null pointer to 
d2b
4. d2b uses the null pointer as the base address 
of a structure located at address zero
 
Apparently sprintf requires more heap space than 
what is available.  My embedded system has approximately 6K bytes available 
for the heap.  What are the minimum requirements for available heap space 
for using sprintf?
 
 



More information about the crossgcc mailing list