Dear developers:

I find it counterintuitive that if I repeatedly reset a variable by using 
strcpy with an empty string "" to that variable and then us strcat to add 
characters to that variable that that seems to lead to a stack overflow.

I would expect strcpy to first free the variable, then malloc, then copy the 
string value into the variable. I think that would be a better interpretation, 
because it can keep running for quite some time before it overflows and doesn’t 
really call it.

Instead, I got "Illegal instruction: 4".

I ended up reimplementing the reset function, implementing it with free and 
malloc myself, but the way strings have been implemented in C is highly 
counter-intuitive. In general pointers tend to be bug-prone, but here you would 
expect this not to happen.

I hope you can fix this. Personally, I’m looking into switching to Ada.

All the best,


Emile M. Hobo


- Au fin! Et encore en plus. -

Reply via email to