consider also changing the outer loop's variable to something that will break it.
i.e.
Code:
for ( i=0; i<40; i++ ) {
    for ( k=0; k<100; k++ ) {
      if (somecondition) {
        i = 40;
        break;
      }
    }
}