On 08/ 5/13 05:00 PM, Pedro Ribeiro wrote:
Thanks for that Alan - I had no idea, and have been looking at lots of C code lately that has probably has the same mistakes. I will keep an eye on that.
More details/deeper explanations of when sizeof can and cannot work can be found in: https://www.securecoding.cert.org/confluence/display/seccode/ARR01-C.+Do+not+apply+the+sizeof+operator+to+a+pointer+when+taking+the+size+of+an+array https://en.wikibooks.org/wiki/C_Programming/Pointers_and_arrays#sizeof -- -Alan Coopersmith- [email protected] Oracle Solaris Engineering - http://blogs.oracle.com/alanc -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

