MESSAGE
DATE | 2004-04-22 |
FROM | Ruben I Safir
|
SUBJECT | Re: [hangout] Debugging cdparanoia in C
|
Also look at line 188 in utils.h
First, I'm confused why we have CODE in a header file.
in function idmessage() at utils.h:188
buffer=malloc(strlen(f)+strlen(s)+10);
What happened to the sizeof macro?
Ruben
On 2004.04.22 06:15 Ruben I Safir wrote: > > ie: malloc in copystring. > > I don't know what was wrong with the standard strcpy program > > Would you recommend using a signal handler for the malloc problem > or just exit. > > If you run out of ram, it might hang the program (and the OS) > > In any event, for anyone following this thread, the malloc command in C allocates > a block of memory for future use, so properly writing an allocation should look something > like: > > char *p; > > if((p=malloc(1000))==NULL){ > fprintf( STDERR, "%s", "Out of RAM - can not allocate more memory"); > exit(0); > } > > Ruben > > -- > __________________________ > Brooklyn Linux Solutions > > So many immigrant groups have swept through our town > that Brooklyn, like Atlantis, reaches mythological > proportions in the mind of the world - RI Safir 1998 > > DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 > http://fairuse.nylxs.com > > http://www.mrbrklyn.com - Consulting > http://www.inns.net <-- Happy Clients > http://www.nylxs.com - Leadership Development in Free Software > http://www2.mrbrklyn.com/resources - Unpublished Archive or stories and articles from around the net > http://www2.mrbrklyn.com/downtown.html - See the New Downtown Brooklyn.... > > 1-718-382-0585 > ____________________________ > NYLXS: New Yorker Free Software Users Scene > Fair Use - > because it's either fair use or useless.... > NYLXS is a trademark of NYLXS, Inc > -- __________________________ Brooklyn Linux Solutions
So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://fairuse.nylxs.com
http://www.mrbrklyn.com - Consulting http://www.inns.net <-- Happy Clients http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive or stories and articles from around the net http://www2.mrbrklyn.com/downtown.html - See the New Downtown Brooklyn....
1-718-382-0585 ____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|