If at the end we are going to use fixed length char variable, then we should check that servicePath.lengt() is leeser than MAX_SERVICE_NAME_LEN (actually, including the extra chars for scaping).