415
edits
Eriktorbjorn (talk | contribs) (Typo) |
Eriktorbjorn (talk | contribs) (Be less obvious about which one is my own preferred bugfix. :-)) |
||
Line 46: | Line 46: | ||
* Change the variables from unsigned to signed. | * Change the variables from unsigned to signed. | ||
* Check for overflow | * Check for overflow before adding the width of the space. (This may be what it's trying to do already by checking if <tt>_printCharCurPos == _printCharMaxPos</tt>.) | ||
* Rewrite the test so that signedness doesn't matter, e.g. <tt>if (_printCharCurPos + count < _printCharMaxPos)</tt> | * Rewrite the test so that signedness doesn't matter, e.g. <tt>if (_printCharCurPos + count < _printCharMaxPos)</tt> | ||
Oddly enough, the original ''does'' use unsigned variables, and take none of these precautions. Is it possible that the compiler ''Adventure Soft'' used behaved differently (buggily?), or are we missing some subtle detail...? | Oddly enough, the original ''does'' use unsigned variables, and take none of these precautions. Is it possible that the compiler ''Adventure Soft'' used behaved differently (buggily?), or are we missing some subtle detail...? |
edits