Wednesday, October 7, 2009

Bugs in OOP344 As1tester.c V0.9

Hey, just thought I'd point out some bugs that may prevent As1tester.c from running correctly on some Borland compilers and the matrix compiler.

In the ResetStr function there is a line of code that looks like this:

while(str[i] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ Garbage after data"[i++]);

On some borland compilers this will result is messed up data, to fix this change it to:

while(str[i] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ Garbage after data"[i])
i++;


And on the matrix and borland compilers, the function prntextbox is broken. The line:

from = from + len + 1;

Allows the compiler to pass the null char, allowing it to read into data that does not really belong to from. Change it to:

from = from + len;

And it works!

No comments:

Post a Comment