I've finished writing the recover function and made it to compile successfully. However, it gives out a segmentation fault every time I try to run it. I ran valgrind and the error was in the first if condition in the while loop. I assume I am not utilizing the variable buffer properly, but I have been googling and checking stackoverflow for quite a while but I can't get at the cause of the problem. Any help would be GREATLY appreciated!
Here's my code:
[removed code per Honor Code]