Re: [LIP] query regarding strtok return value.
<ripley-gGZFqZ9RcmRmR6Xm/[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Organization | Portal Agory S.A. |
| Message-ID | <[email protected]> |
Hi :) Assuming: char *result; result = strtok(...); You can't do free (result) because strtok probably doesn't use malloc when returning - you'll get segmentation fault. It only pass a address to a pointer. I think you have only to write result=0; Hope To Help Asia Sledzik ------ WiadomoĹÄ oryginalna ------ Od: Shehjar Tikoo <shehjar_tikoo-/[email protected]> Data: 2004-01-09 11:58 Temat: [LIP] query regarding strtok return value. :-> Hi all :-> :-> I would like to know what I am supposed to do with the :-> pointer to the buffers returned by strtok function :-> with respect to freeing up of memory? :-> :-> Should I call free on the pointers returned when I am :-> done working on them or do something else? :-> :-> Thanks in advance. :-> :-> Shehjar :-> :-> __________________________________ :-> Do you Yahoo!? :-> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes :-> http://hotjobs.sweepstakes.yahoo.com/signingbonus :-> :-> :-> ------------------------------------------------------- :-> This SF.net email is sponsored by: Perforce Software. :-> Perforce is the Fast Software Configuration Management System offering :-> advanced branching capabilities and atomic changes on 50+ platforms. :-> Free Eval! http://www.perforce.com/perforce/loadprog.html :-> _______________________________________________ :-> linux-india-programmers mailing list :-> linux-india-programmers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org :-> https://lists.sourceforge.net/lists/listinfo/linux-india- programmers :-> :-> ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html