That edit is correct. With that one line change, your left rotation is 100% correct. You need to make the corresponding change for the right rotation as well.
Of course neither of these will appear to work correctly until you have a way of modifying the head. E.g. you need to pass your pointers by pointer, so that you can modify them.
If this were C++ then you'd use references in which case you could add an "&" and you'd be done.