Hi;
I tried checking your code(though i dont code in C but atleast i can read some of it) but what i can see though i might be wrong, in your code for the slave i cant see where an address is defined for the slave, and how its going to know that its the one to receive the message and act on it.
i think you check very well and act on it.
and again since you did not post any circuit here i hope you attached pullup resistors on the lines (sclk and sdata).
Hope this helps
tunde