Closed xuchunyang closed 10 years ago
It's necessary.
It's necessary.
hmm, necessary for what exactly?
I am new to C programming and I plan to give up this pull request and create my own todo command line tool. Thank you for sharing the code.
Check the return of malloc is a good practice but the manual says :
man malloc(3)
section NOTES
By default, Linux follows an optimistic memory allocation strategy. This means that when malloc() returns non-NULL there is no guarantee that the memory really is available.
But It's always a good idea to check if a pointer is valid before using it.
For the cast of malloc's return, I don't know the reason of that, you can read everything about that on internet.
Thanks @nutsi .
malloc()
malloc()
, success or failure, life or death