Segmentation Faults and Bus Errors
I was casting pointers to integers, and I'm pretty sure that I immediately go "out-of-bounds" when accessing the heap, yet I'm not sure how or why.
Maybe I'm hitting a null pointer?
Does anyone think that they could help me out?
When reading byte by byte, my
compare function seems to access one extra index, yet it shouldn't.
An example of the old error is shown on line 26 of main.cpp, it no longer errors, but instead just produces incorrect results.
compareis the function that is causing the segfault, but I'm also rapidly rewriting everything here.
It's when I cast and dereference.
Around line ~30.
strcmpis a specialized wrapper for
comparejust compares sequences of bytes, I was going to fix the last bit of
strcmp, it's calculating the
countincorrectly, but I still believe that
strcmp = string compare.
I'm renaming it to streq instead now.