When traversing a linked list, be sure to:
1. initialize your temp pointer 2. advance your temp pointer
<bart simpson mode>
for(i=0;i<bb_size;i++) { fprintf(bb,"I will not leave my temp pointer uninitialised"); }
for(i=0;i<bb_size;i++) { fprintf(bb,"I will not forget to advance my temp pointer"); }
</bart simpson mode>
Mostly, read http://www.livejournal.com/users/satyap/