Linus Åkerlund wrote:
>
> Yes, the code was buggy of course, it's a small wonder that the
> non-optimized binary didn't coredump as well, because I was writing
> beyond the end of a string... Thanks for the explanation anyway! I've
> never programmed any assembler, so I really have no idea what
> optimizations do to the code. I imagined it was just a magical way of
> making it run faster, but now I know better.
Let me guess - was one of your optimisations a space optimisation?
Memory allocation doesn't normally allocate exactly what you asked for;
it will allocate up to the next 16, or 32, or some other number, bytes.
So unoptimised char x[12]; x[13]=0 may work, because you've actually got
16, but if you optimise this you will only have 12 and therefore a
crash.
Why aren't you using C++ and smart strings?
Dave.
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject.