why are you using malloc?...Why do you have your own BDArr and BDFifo implementations anyway?
I wrote those libraries i'm using as just a test. I did them in C style because I eventually want to write a programming language that is translated to C, then compiled. I'm aware of the limitations of my implimentation - and I did want to switch to using STL, but I failed to port it correctly, and didn't really feel like debugging that. The dot-h libraries it uses are not meant to be pristine - in fact I do realize they contain some pretty bad coding practice.
You shouldn't use gets for the same reason.
What should I use?
Paste an example where fgets is behaving buggily and I can take a look.
I messed around with my calculator example and found that when I added a printf statment after getting the line, my function crashes as well. I've assumed these types of crashes are the result of some kind of corruption in my compiler, I should compile the program on another system. If this program runs fine for you, then my compiler probably has some issue:
http://www.uweb.ucsb.edu/~frenchenee...Calculator.cpp
(make sure if you compile it, don't use optimizations)