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

goto, not much worse than break/continue

Name: Anonymous 2005-02-21 17:56

Discuss.

Name: Anonymous 2010-10-02 16:30

>>6
Paw. Here is my response:
for (zomg = 0, blah; !zomg; blah) {
    blah;
    zomg += error;
    blah;
    zomg += error;
    blah;
    zomg += error;
}

if (zomg) {
    fprintf( stderr, "
HAX MY ANUS" );
}


It's never too late.

Name: Anonymous 2010-10-02 17:10

>>57
Does not generalize well and depends on error codes.
If your error codes are negative, positive or whatever, the sum can be unpredictable and this could even be exploitable by a malicious user. However, your idea can work in some cases. Here's a variation on it which will always work as long as success error code is 0 and any non-zero return code is an error:


anyerror = 0
...
anyerror |= op(...);
...
anyerror |= op(...);

if (anyerror)
  handle_failure(...);

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