Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Program won't crash when it should

Name: Anonymous 2012-01-16 3:24

(GCC C)
I ran a pointer over each member of an integer array, storing one character of input in each cell.

The program seems to consistently crash when I try to store X+3 or more characters, where X is the size of the array, but if I do not exceed X+2 it will not crash.

Why does it crashes exactly at the point it does, but not for X+1 or X+2?

Name: Anonymous 2012-01-16 22:07

>>127

I reread that here too.

From what I understood, this says that the data effectively written will not compare equal to the data which were supposedly written, when read back in. But it does not say that if the written data does not terminate in a newline, the program will exhibit undefined behavior.

Nonetheless, I believe that something in the lines of >>64 applies in this situation. There might have been an unintentional omission from the committee, either for deciding that partial text streams are invalid, or that they are valid. Regardless, wasting time in this kind of discussion is surely not something the standard was intended to do in the first place.

There are more interesting and significant examples of undefined behavior that affect day-to-day programming and, specially, security. Even Kodak himself, filtering through his gigantic morass of offenses and violence, provided a good one.

>>124
>>128

This is some sort of serious personality flaw. Fortunately it's fixable, but it takes time and effort. I rarely relate personally to online peers, though. I just consider myself having been trolled in this case.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List