|
|||||||||||
|
Re: safe strcpy()?
From: Brandon Erhart <berhart(at)ErhartGroup.COM>
Date: Tue Jan 28 2003 - 12:21:19 EST
At 03:14 AM 1/28/2003, you wrote:
That's the source of a lot of problems, though. Bugs that pop up just NOW AND THEN when the stack gets fubar'd by some seemingly innocent code (which has happened to me many a time -- hard to find it). Semi-Interesting-for-those-who-don't-know: A fellow in #C on EFnet IRC once suggested I put a char array w/ a large length as the first variable in the block of code I thought it was happening at. I did it, and the bug "went away" (the variable was being written into instead of smooshing the stack due to lack of size since we had increased it). Not a fix, but a way of debugging, just thought I'd share that. >For dynamically allocated memory, you might want to use
Thank you Michal. I will try it :) Indirectly helping everyone !!
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:45 EDT |
||||||||||
|
|||||||||||