Why are you casting this to (char *) ?  The expression being cast already has that type !
Casts are unpleasant, but wanton casts just cause pain to the reader and create risks of problems going unnoticed.