Since things are all MCStringRef's here (the MCservercgiheaders and p_s) you should be able to update to use MCString methods, rather than going through c-strings...